77 - ' master'
88 - ' ci*' # Allow testing CI fixes without opening a PR
99
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+ cancel-in-progress : true
13+
1014permissions :
1115 contents : read
1216
2226 - examples-darwin
2327 - examples-linux
2428 - tests
29+ - zizmor
2530
2631 tests :
2732 strategy :
@@ -31,27 +36,36 @@ jobs:
3136 include :
3237 # NB: current latest release of 2.33.0 has bugs
3338 - install_url : https://releases.nixos.org/nix/nix-2.31.2/install
39+ name : run tests
3440 # Latest and greatest release of Nix
3541 # - install_url: https://nixos.org/nix/install
3642 # The 25.11 branch ships with Nix 2.31.2
3743 - install_url : https://releases.nixos.org/nix/nix-2.31.2/install
38- nixpkgs-override : " --override-input nixpkgs $(./ci/ref-from-lock.sh ./test#nixpkgs-latest-release)"
44+ USE_LATEST_RELEASE : " 1"
45+ name : run tests 25.11
3946 runs-on : ubuntu-latest
47+ name : ${{ matrix.name }}
48+ environment : cachix
49+ env :
50+ USE_LATEST_RELEASE : ${{ matrix.USE_LATEST_RELEASE }}
4051 steps :
41- - uses : actions/checkout@v7
42- - uses : cachix/install-nix-action@v31
52+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
53+ with :
54+ persist-credentials : false
55+ - uses : cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
4356 with :
4457 install_url : ${{ matrix.install_url }}
45- - uses : cachix/cachix-action@v17
58+ - uses : cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
4659 with :
4760 name : crane
4861 authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
4962 - run : nix flake check -L .#
50- - run : nix develop --accept-flake-config --command ./ci/fast-flake-check .sh ./test ${{ matrix.nixpkgs-override }}
63+ - run : ./ci/run-test-suite .sh
5164 - name : extra tests
52- run : nix develop --accept-flake-config --command ./extra-tests/test.sh
65+ run : nix develop .#ci --accept-flake-config --command ./extra-tests/test.sh
5366
5467 examples-linux :
68+ name : build examples
5569 strategy :
5670 # Allow other jobs to finish building and cache properly before bailing
5771 fail-fast : false
@@ -71,10 +85,15 @@ jobs:
7185 - trunk-workspace
7286 - trunk
7387 runs-on : ubuntu-latest
88+ environment : cachix
89+ env :
90+ EXAMPLE : ${{ matrix.example }}
7491 steps :
75- - uses : actions/checkout@v7
76- - uses : cachix/install-nix-action@v31
77- - uses : cachix/cachix-action@v17
92+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
93+ with :
94+ persist-credentials : false
95+ - uses : cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
96+ - uses : cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
7897 with :
7998 name : crane
8099 authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
@@ -84,17 +103,21 @@ jobs:
84103 # "opt-out" of our lockfile .gitignore
85104 run : |
86105 rm ./examples/.gitignore
87- nix develop .# --accept-flake-config --command ./ci/check-example.sh ./examples/${{ matrix.example }} "./test#nixpkgs"
106+ nix develop .#ci --accept-flake-config --command ./ci/check-example.sh " ./examples/${EXAMPLE}" "./test#nixpkgs"
88107
89108 examples-darwin :
109+ name : build examples (darwin)
90110 strategy :
91111 # Allow other jobs to finish building and cache properly before bailing
92112 fail-fast : false
93113 runs-on : macos-latest
114+ environment : cachix
94115 steps :
95- - uses : actions/checkout@v7
96- - uses : cachix/install-nix-action@v31
97- - uses : cachix/cachix-action@v17
116+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
117+ with :
118+ persist-credentials : false
119+ - uses : cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
120+ - uses : cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
98121 with :
99122 name : crane
100123 authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
@@ -104,26 +127,45 @@ jobs:
104127 # "opt-out" of our lockfile .gitignore
105128 run : |
106129 rm ./examples/.gitignore
107- nix develop .# --accept-flake-config --command bash -c '
108- set -euo pipefail
109- for f in $(find ./examples -maxdepth 1 -mindepth 1 -type d -not -name build-std -not -name cross-musl -not -name cross-rust-overlay -not -name cross-windows | sort -u); do
110- # NB: nix-eval-jobs appears broken on darwin atm?
111- # /nix/store/2419grj384lg233jqchamm73il9iyjxg-libcxx-16.0.6-dev/include/c++/v1/optional:962: assertion this->has_value() failed: optional operator* called on a disengaged valueerror: error: while checking worker process, evaluation worker got killed by signal 6 (Abort trap: 6)
112- nix flake check \
113- --accept-flake-config \
114- --print-build-logs \
115- --reference-lock-file ./test/flake.lock \
116- --override-input crane ./. \
117- "${f}"
118- done
119- '
130+ set -euo pipefail
131+ for f in $(find ./examples -maxdepth 1 -mindepth 1 -type d -not -name build-std -not -name cross-musl -not -name cross-rust-overlay -not -name cross-windows | sort -u); do
132+ nix flake check \
133+ --accept-flake-config \
134+ --print-build-logs \
135+ --reference-lock-file ./test/flake.lock \
136+ --override-input crane ./. \
137+ "${f}"
138+ done
120139
121140 lints :
122141 runs-on : ubuntu-latest
142+ name : check lints
123143 steps :
124- - uses : actions/checkout@v7
125- - uses : cachix/install-nix-action@v31
144+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
145+ with :
146+ persist-credentials : false
147+ - uses : cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
126148 - name : check formatting
127149 run : nix fmt -- --ci
128150 - name : check for dead code
129- run : nix develop .# --command deadnix .
151+ run : nix develop .#deadnix --command deadnix .
152+
153+ zizmor :
154+ name : run zizmor
155+ runs-on : ubuntu-latest
156+ permissions :
157+ security-events : write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
158+ steps :
159+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
160+ with :
161+ persist-credentials : false
162+ - uses : cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
163+ - name : Run zizmor 🌈
164+ run : nix develop .#zizmor --command zizmor --persona=auditor --format=sarif . >results.sarif
165+ env :
166+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
167+ - name : Upload SARIF file
168+ uses : github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
169+ with :
170+ sarif_file : results.sarif
171+ category : zizmor
0 commit comments