ci: run checks
This commit is contained in:
parent
67adbe7089
commit
782b05c59e
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@ -3,6 +3,24 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
checks:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
check:
|
||||||
|
- nixpkgs-fmt
|
||||||
|
- deadnix
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: action/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v19
|
||||||
|
- name: Check ${{ matrix.check }}
|
||||||
|
# Depends on nixos/nix#7759 to simply `nix flake check`
|
||||||
|
run:
|
||||||
|
- export SYSTEM=$(nix eval --raw --impure --expr "builtins.currentSystem")
|
||||||
|
- nix run .#checks.$SYSTEM.${{ matrix.check }}
|
||||||
|
|
||||||
build-and-update:
|
build-and-update:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
11
flake.nix
11
flake.nix
@ -20,7 +20,16 @@
|
|||||||
(_: drv: builtins.elem system (drv.meta.platforms or [ ]))
|
(_: drv: builtins.elem system (drv.meta.platforms or [ ]))
|
||||||
(import ./pkgs/top-level/all-packages.nix { inherit pkgs; });
|
(import ./pkgs/top-level/all-packages.nix { inherit pkgs; });
|
||||||
|
|
||||||
devShells.ci = pkgs.mkShell {
|
checks = {
|
||||||
|
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
|
||||||
|
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
|
||||||
|
'';
|
||||||
|
deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
|
||||||
|
${pkgs.deadnix}/bin/deadnix --fail .
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells.ci = pkgs.mkShellNoCC {
|
||||||
buildInputs = [ pkgs.nix-build-uncached ];
|
buildInputs = [ pkgs.nix-build-uncached ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user