This repository has no description
2.4 kB
83 lines
1name: CI
2
3on:
4 push:
5 pull_request:
6
7# nix flake check evaluates every host in one process (~19 GB peak), more than
8# the 16 GB RAM of ubuntu-latest. One job per check keeps the peak at the
9# largest single host and shows failing hosts in the run overview.
10jobs:
11 list:
12 runs-on: ubuntu-latest
13 outputs:
14 checks: ${{ steps.list.outputs.checks }}
15 steps:
16 - uses: actions/checkout@v4
17 with:
18 # Fetch all history for git-based operations
19 fetch-depth: 0
20
21 - uses: DeterminateSystems/nix-installer-action@main
22 with:
23 extra-conf: |
24 experimental-features = nix-command flakes
25
26 - uses: DeterminateSystems/magic-nix-cache-action@main
27 with:
28 use-flakehub: false
29
30 - id: list
31 run: |
32 checks=$(nix eval --json .#checks.x86_64-linux --apply builtins.attrNames)
33 echo "checks=$checks" >> "$GITHUB_OUTPUT"
34
35 check:
36 needs: list
37 name: ${{ matrix.check }}
38 runs-on: ubuntu-latest
39 strategy:
40 fail-fast: false
41 matrix:
42 check: ${{ fromJSON(needs.list.outputs.checks) }}
43 steps:
44 - uses: actions/checkout@v4
45 with:
46 # Fetch all history for git-based operations
47 fetch-depth: 0
48
49 - uses: DeterminateSystems/nix-installer-action@main
50 with:
51 extra-conf: |
52 experimental-features = nix-command flakes
53
54 - uses: DeterminateSystems/magic-nix-cache-action@main
55 with:
56 use-flakehub: false
57
58 - run: nix build -L --no-link '.#checks.x86_64-linux.${{ matrix.check }}'
59
60 outputs:
61 name: packages and devShells
62 runs-on: ubuntu-latest
63 steps:
64 - uses: actions/checkout@v4
65 with:
66 # Fetch all history for git-based operations
67 fetch-depth: 0
68
69 - uses: DeterminateSystems/nix-installer-action@main
70 with:
71 extra-conf: |
72 experimental-features = nix-command flakes
73
74 - uses: DeterminateSystems/magic-nix-cache-action@main
75 with:
76 use-flakehub: false
77
78 - run: |
79 for output in packages devShells; do
80 echo "$output:"
81 # shellcheck disable=SC2016 # ${...} is Nix interpolation
82 nix eval --raw ".#$output.x86_64-linux" --apply 'xs: builtins.deepSeq (builtins.mapAttrs (_: x: x.drvPath) xs) "${toString (builtins.length (builtins.attrNames xs))} evaluated\n"'
83 done