summaryrefslogtreecommitdiff
path: root/checks.nix
blob: 56c50389a589c636e4b314533dfb7c9020d07206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  perSystem =
    { pkgs, ... }:
    {
      checks = {
        check-formatting =
          pkgs.runCommand "check-formatting" { nativeBuildInputs = [ pkgs.nixfmt-rfc-style ]; }
            ''
              cd ${./.}

              echo "running nixfmt..."
              nixfmt --check .

              touch $out
            '';

        check-lint =
          pkgs.runCommand "check-lint"
            {
              nativeBuildInputs = [
                pkgs.actionlint
                pkgs.deadnix
                pkgs.statix
              ];
            }
            ''
              cd ${./.}

              echo "running actionlint..."
              actionlint ./.github/workflows/*

              echo "running deadnix..."
              deadnix --fail

              echo "running statix..."
              statix check .

              touch $out
            '';
      };
    };
}