From c440b2f70b6f1f2f3d9617644ba4010b9bd7e39b Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Fri, 1 Dec 2023 11:59:26 +0100 Subject: [PATCH] Run the tests in the nix build --- .github/workflows/ci.yml | 9 +++++++++ flake.nix | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c006e8f..1363a91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,3 +54,12 @@ jobs: python -m pip install .[doc] - name: Build the documentation run: make -C doc html man + + nix: + runs-on: ubuntu-latest + steps: + - name: Install Nix + uses: cachix/install-nix-action@v20 + - uses: actions/checkout@v3 + - name: Build the nix derivation (also runs the tests) + run: nix build --print-build-logs diff --git a/flake.nix b/flake.nix index e388aab..f48e883 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,9 @@ cp -r $src/khard/data $out/lib/python*/site-packages/khard ''; src = ./.; + pyproject = true; + doCheck = true; + checkPhase = "python -m unittest -v"; }); devShells.x86_64-linux.release = let pkgs = nixpkgs.legacyPackages.x86_64-linux; in