ci: add flake checks
This commit is contained in:
parent
4e342aa8ee
commit
8516529bbc
1 changed files with 23 additions and 0 deletions
23
flake.nix
23
flake.nix
|
@ -21,6 +21,29 @@
|
||||||
nixpkgsFor = nixpkgs.legacyPackages;
|
nixpkgsFor = nixpkgs.legacyPackages;
|
||||||
in
|
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 (
|
devShells = forAllSystems (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue