Skip to content

Commit f7baf34

Browse files
committed
ci: add nix-build job and required-checks job
Add a `nix-build` job to verify `nix build` works for all the packages in the flake. Add a `required-checks` job to make branch protection easier, meaning we can add more jobs with only a code modification instead of a config change on the repo. Test plan: - CI
1 parent 8374119 commit f7baf34

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ jobs:
1414
nix --experimental-features 'nix-command flakes' fmt
1515
git diff --exit-code
1616
17+
nix-build:
18+
name: Test Nix build
19+
runs-on: 16-core-ubuntu
20+
steps:
21+
- uses: actions/[email protected]
22+
- uses: cachix/install-nix-action@v27
23+
- run: |
24+
nix flake show --json \
25+
| jq -r '.packages."x86_64-linux" | keys[]' \
26+
| sed 's/^/.#/' \
27+
| xargs nix build
28+
1729
build-test:
1830
runs-on: 16-core-ubuntu
1931
strategy:
@@ -52,3 +64,16 @@ jobs:
5264
with:
5365
name: test-results-${{ matrix.llvm_version }}
5466
path: build/test/results.xml
67+
68+
required-checks:
69+
runs-on: ubuntu-latest
70+
needs: [
71+
lint,
72+
nix-build,
73+
build-test,
74+
]
75+
if: always()
76+
env:
77+
NEEDS_CONTEXT: ${{ toJSON(needs) }}
78+
steps:
79+
- run: echo "$NEEDS_CONTEXT" | jq -e 'to_entries | all(.value.result == "success")'

0 commit comments

Comments
 (0)