From 70ce558cd0fea3e16265f0e6e4342b223b9e41ad Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Mon, 21 Jun 2021 09:24:31 +0000 Subject: [PATCH] CI: build-test-package pipeline --- .gitlab-ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f53eddc..8002b82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,22 @@ +stages: + - Build + - Test + - Package + variables: NIX_PATH: "nixpkgs=channel:nixos-21.05" build: + stage: Build script: - nix-shell --pure --run "file src/main/resources/language/translation_de.properties | rg UTF-8" + - nix-shell --pure --run "mvn --no-transfer-progress -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp compile" + +test: + stage: Test + dependencies: + - build + script: - nix-shell --pure --run "mvn --no-transfer-progress -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp checkstyle:check jacoco:prepare-agent test jacoco:report" - nix-shell --pure --run "python3 ./cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml" - nix-shell --pure --run "python3 ./source2filename.py target/site/cobertura.xml" @@ -11,3 +24,13 @@ build: artifacts: reports: cobertura: target/site/cobertura.xml + +package: + stage: Package + dependencies: + - test + script: + - nix-shell --pure --run "mvn --no-transfer-progress -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp clean package -Pproduction" + artifacts: + paths: + - target/typicalc-1.0-SNAPSHOT.jar \ No newline at end of file