From 297f086147f55434d19a3c9816a6dfbb8ef2ba09 Mon Sep 17 00:00:00 2001 From: Scherbaum Maximilian <ms622@hdm-stuttgart.de> Date: Thu, 22 Feb 2024 11:10:52 +0100 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 158a7644..11834ac0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,17 @@ -#include: - # - template: Jobs/SAST.gitlab-ci.yml +include: + - template: Jobs/SAST.gitlab-ci.yml cache: paths: - .m2/repository -stages: - - build - #- test - #- package - variables: MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository" +stages: + - build + - test + - package build-battlearena: stage: build @@ -21,3 +20,28 @@ build-battlearena: - "echo 'Starting Build Stage'" - "mvn compile -X" +test-battlearena: + stage: test + image: maven:3.9.4-eclipse-temurin-20 + script: + - "echo 'Starting Test Stage'" + - "mvn test" + artifacts: + reports: + junit: + - target/surefire-reports/TEST-*.xml + - target/failsafe-reports/TEST-*.xml + +package-battlearena: + stage: package + image: maven:3.9.4-eclipse-temurin-20 + script: + - "echo 'Starting Package Stage'" + - "mvn package" + only: + refs: + - main + artifacts: + paths: + - target/*.jar + expire_in: 2 days -- GitLab