From b02c5d8b9e097fd027e0056c849b2587c721ee24 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Tue, 15 Jun 2021 11:58:01 +0200 Subject: [PATCH 1/2] CI: use helper scripts in repo --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3e2684..743fca0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,9 @@ build: script: - file src/main/resources/language/translation_de.properties | rg UTF-8 - mvn -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp checkstyle:check jacoco:prepare-agent test jacoco:report - - python3 /opt/cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml - - python3 /opt/source2filename.py target/site/cobertura.xml - - /opt/calcCoverage.sh < target/site/cobertura.xml + - python3 ./cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml + - python3 ./source2filename.py target/site/cobertura.xml + - ./calcCoverage.sh < target/site/cobertura.xml artifacts: reports: cobertura: target/site/cobertura.xml From 289e97f254886510f25b4c8c79d27fb9004bbdb1 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Tue, 15 Jun 2021 12:25:59 +0200 Subject: [PATCH 2/2] CI: use nix-shell --- .gitlab-ci.yml | 13 ++++++++----- shell.nix | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 shell.nix diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 743fca0..ebdcf52 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,13 @@ +variables: + NIX_PATH: "nixpkgs=channel:nixos-21.05" + build: script: - - file src/main/resources/language/translation_de.properties | rg UTF-8 - - mvn -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp checkstyle:check jacoco:prepare-agent test jacoco:report - - python3 ./cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml - - python3 ./source2filename.py target/site/cobertura.xml - - ./calcCoverage.sh < target/site/cobertura.xml + - nix-shell --pure --run "file src/main/resources/language/translation_de.properties | rg UTF-8" + - nix-shell --pure --run "mvn -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" + - nix-shell --pure --run "./calcCoverage.sh < target/site/cobertura.xml" artifacts: reports: cobertura: target/site/cobertura.xml diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..cda006f --- /dev/null +++ b/shell.nix @@ -0,0 +1,20 @@ +with (import {}); +let + mavenJdk11 = maven.override { + jdk = pkgs.jdk11; + }; + my-python3-packages = python3-packages: with python3-packages; [ + lxml + ]; + python3-with-my-packages = pkgs.python3.withPackages my-python3-packages; +in +mkShell { + nativeBuildInputs = [ + file + ripgrep + mavenJdk11 + nodejs-14_x + which # required by Vaadin + python3-with-my-packages + ]; +}