From 97a78ba6b20cbd60c63b69fcaa4f60e12e46bedb Mon Sep 17 00:00:00 2001 From: SomeoneSerge Date: Thu, 8 Aug 2024 21:16:24 +0000 Subject: flake.nix: add .#checks --- .github/workflows/build.yml | 14 ++++++++++++++ flake.nix | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4285978..936d055 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,3 +22,17 @@ jobs: - uses: DeterminateSystems/magic-nix-cache-action@v7 - name: Build some-pkgs run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#packages" + nix-flake-check: + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v13 + - uses: DeterminateSystems/magic-nix-cache-action@v7 + - name: Build the checks + run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)" diff --git a/flake.nix b/flake.nix index 8421959..e86dc6b 100644 --- a/flake.nix +++ b/flake.nix @@ -71,5 +71,24 @@ }; } ); + checks = forAllSystems ( + { system, pkgs, ... }: + let + inherit (pkgs.lib) + filterAttrs + isDerivation + mapAttrs' + nameValuePair + pipe + ; + in + pipe self.legacyPackages.${system}.nixosTests [ + (filterAttrs (_: p: isDerivation p)) + (mapAttrs' (name: nameValuePair "nixosTests-${name}")) + ] + // { + inherit (self.packages.${system}) evanix evanix-py; + } + ); }; } -- cgit v1.2.3