1- name : CI
2-
31on :
42 merge_group :
53 pull_request :
64 push :
75 branches : [main]
86
97jobs :
10- build :
11- name : Build
12- runs-on : ubuntu-22.04
13- steps :
14- - uses : actions/checkout@v4
15- - name : Install Nix
16- uses : DeterminateSystems/nix-installer-action@main
17- - uses : DeterminateSystems/flakehub-cache-action@main
18- - name : Check shell scripts
19- run : |
20- nix develop --command shellcheck ./.github/workflows/cache-test.sh
21- - uses : DeterminateSystems/nix-installer-action@main
22- - name : Install pnpm dependencies
23- run : nix develop --command pnpm install
24- - name : Check formatting
25- run : nix develop --command pnpm run check-fmt
26- - name : Lint
27- run : nix develop --command pnpm run lint
28- - name : Build
29- run : nix develop --command pnpm run build
30- - name : Package
31- run : nix develop --command pnpm run package
32- - run : git status --porcelain=v1
33- - run : git diff --exit-code
34-
35- test-no-nix :
36- needs : build
37- name : " Test: Nix not installed"
38- runs-on : ubuntu-22.04
39- permissions :
40- id-token : " write"
41- contents : " read"
42- env :
43- ACTIONS_STEP_DEBUG : true
44- steps :
45- - uses : actions/checkout@v4
46- - name : Cache the store
47- uses : ./
48- with :
49- _internal-strict-mode : true
50-
51- run-x86_64-linux-untrusted :
52- needs : build
53- name : Run x86_64-linux, Untrusted
54- runs-on : ubuntu-22.04
55- permissions :
56- id-token : " write"
57- contents : " read"
58- env :
59- ACTIONS_STEP_DEBUG : true
60- steps :
61- - uses : actions/checkout@v4
62- - name : Install Nix
63- uses : DeterminateSystems/nix-installer-action@main
64- with :
65- flakehub : true
66- extra-conf : |
67- narinfo-cache-negative-ttl = 0
68- trusted-users = root
69- - name : Cache the store
70- uses : ./
71- with :
72- _internal-strict-mode : true
73-
748 run-systems :
75- if : github.event_name == 'merge_group'
76- needs : build
77- name : " Test: ${{ matrix.systems.nix-system }} gha:${{matrix.use-gha-cache}},fhc:${{matrix.use-flakehub}},id:${{matrix.id-token}},determinate:${{matrix.determinate}}"
9+ # if: github.event_name == 'merge_group'
10+ name : " Test: ${{ matrix.systems.nix-system }}"
7811 runs-on : " ${{ matrix.systems.runner }}"
7912 permissions :
8013 id-token : " write"
8417 strategy :
8518 fail-fast : false
8619 matrix :
87- determinate : [true, false]
88- id-token : ["write", "none"]
8920 systems :
9021 - nix-system : " aarch64-darwin"
9122 runner : " macos-latest"
@@ -98,27 +29,50 @@ jobs:
9829 steps :
9930 - uses : actions/checkout@v4
10031 - name : Install Nix on ${{ matrix.systems.nix-system }} system
101- uses : DeterminateSystems/nix-installer -action@main
32+ uses : DeterminateSystems/determinate-nix -action@main
10233 with :
103- _internal-obliterate-actions-id-token-request-variables : ${{ matrix.id-token == 'none' }}
104- determinate : ${{ matrix.determinate }}
10534 extra-conf : |
10635 narinfo-cache-negative-ttl = 0
10736 - name : Cache the store
10837 uses : ./
10938 with :
11039 _internal-strict-mode : true
111- _internal-obliterate-actions-id-token-request-variables : ${{ matrix.id-token == 'none' }}
11240 - name : Check the cache for liveness
11341 env :
114- EXPECT_FLAKEHUB : ${{ toJson(matrix.id-token == 'write') }}
11542 EXPECT_GITHUB_CACHE : ${{ toJson(false) }}
11643 run : |
11744 .github/workflows/cache-test.sh
11845
46+ lint :
47+ name : Build
48+ runs-on : ubuntu-latest
49+ permissions :
50+ id-token : " write"
51+ contents : " read"
52+ steps :
53+ - uses : actions/checkout@v4
54+ - uses : DeterminateSystems/determinate-nix-action@v3
55+ - uses : ./.
56+ - run : nix develop -c typos
57+ if : success() || failure()
58+ - run : nix develop -c ruff check
59+ if : success() || failure()
60+ - run : nix develop -c ruff format --diff
61+ if : success() || failure()
62+ - run : nix develop -c shellcheck ./tools/*.sh
63+ if : success() || failure()
64+ - name : Regenerate the README to make sure it is unchanged
65+ run : nix develop -c ./tools/generate.sh
66+ if : success() || failure()
67+ - name : Assert no changes were made
68+ run : git diff --exit-code
69+ if : success() || failure()
70+
11971 success :
12072 runs-on : ubuntu-latest
121- needs : run-systems
73+ needs :
74+ - run-systems
75+ - lint
12276 if : always()
12377 steps :
12478 - run : " true"
0 commit comments