Skip to content

Commit

Permalink
ci: add flake checks
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed Nov 11, 2024
1 parent 6caf978 commit 1d1e122
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@
nixpkgsFor = nixpkgs.legacyPackages;
in
{
checks = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
mkCheck =
name: deps: script:
pkgs.runCommand name { nativeBuildInputs = deps; } ''
${script}
touch $out
'';
in
{
actionlint = mkCheck "check-actionlint" [ pkgs.actionlint ] "actionlint ${./.github/workflows}/*";
deadnix = mkCheck "check-deadnix" [ pkgs.deadnix ] "deadnix --fail ${self}";
statix = mkCheck "check-statix" [ pkgs.statix ] "statix check ${self}";
nixfmt = mkCheck "check-nixfmt" [ pkgs.nixfmt-rfc-style ] "nixfmt --check ${self}";
rustfmt = mkCheck "check-rustfmt" [
pkgs.cargo
pkgs.rustfmt
] "cd ${self} && cargo fmt -- --check";
}
);

devShells = forAllSystems (
system:
let
Expand Down

0 comments on commit 1d1e122

Please sign in to comment.