From 73185ec007f5572a9425cc11ae89368164f78db7 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Wed, 29 May 2024 16:47:58 +0200 Subject: [PATCH 1/2] Fix coverage generation --- .gitignore | 1 + flake.nix | 31 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index ad8e8b92..fca52d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,4 @@ venv/ venv-*/ .venv/ node_modules/ +result/ diff --git a/flake.nix b/flake.nix index 0ec8d8f8..d5299d8c 100644 --- a/flake.nix +++ b/flake.nix @@ -102,8 +102,18 @@ doCheck = false; }; in { - checks = rec { - default = simple-tests; + packages = rec { + default = tested; + tested = poetry.mkPoetryApplication { + inherit (tested-env) + projectDir python overrides propagatedBuildInputs; + doCheck = false; + postInstall = '' + wrapProgram "$out/bin/tested" \ + --prefix NODE_PATH : ${ast}/lib/node_modules + ''; + }; + devShell = self.outputs.devShells.${system}.default; simple-tests = pkgs.stdenvNoCC.mkDerivation { name = "simple-tests"; src = self; @@ -117,23 +127,10 @@ poetry run pytest -n auto --cov=tested --cov-report=xml tests/test_functionality.py ''; installPhase = '' - touch $out # it worked! - ''; - }; - }; - - packages = rec { - default = tested; - tested = poetry.mkPoetryApplication { - inherit (tested-env) - projectDir python overrides propagatedBuildInputs; - doCheck = false; - postInstall = '' - wrapProgram "$out/bin/tested" \ - --prefix NODE_PATH : ${ast}/lib/node_modules + mkdir -p $out + cp coverage.xml $out/coverage.xml ''; }; - devShell = self.outputs.devShells.${system}.default; }; devShells = rec { From ffaeb870e87d7b69c3fd15a61b00de7e394620c4 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Wed, 29 May 2024 16:50:36 +0200 Subject: [PATCH 2/2] Fix upload of coverage information --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c5c9e60..9858e272 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - run: echo "${GITHUB_WORKSPACE}" >> $GITHUB_PATH - - run: nix flake check --print-build-logs + - run: nix build .#simple-tests --print-build-logs - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./result/coverage.xml lint: runs-on: ubuntu-latest steps: