ci: run checks

This commit is contained in:
xeals 2023-02-23 10:51:53 +11:00
parent 67adbe7089
commit 782b05c59e
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
2 changed files with 28 additions and 1 deletions

View File

@ -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:

View File

@ -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 ];
}; };