File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 2929 github_token : ${{ secrets.GITHUB_TOKEN }}
3030 - run : nix flake show --all-systems --json
3131
32+ pre-commit-checks :
33+ name : pre-commit checks
34+ runs-on : ubuntu-24.04
35+ steps :
36+ - uses : actions/checkout@v5
37+ - uses : ./.github/actions/install-nix-action
38+ with :
39+ dogfood : ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
40+ extra_nix_config : experimental-features = nix-command flakes
41+ github_token : ${{ secrets.GITHUB_TOKEN }}
42+ - uses : DeterminateSystems/magic-nix-cache-action@main
43+ - run : ./ci/gha/tests/pre-commit-checks
44+
45+ basic-checks :
46+ name : aggregate basic checks
47+ if : ${{ always() }}
48+ runs-on : ubuntu-24.04
49+ needs : [pre-commit-checks, eval]
50+ steps :
51+ - name : Exit with any errors
52+ if : ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
53+ run : |
54+ exit 1
55+
3256 tests :
57+ needs : basic-checks
3358 strategy :
3459 fail-fast : false
3560 matrix :
@@ -214,6 +239,7 @@ jobs:
214239 docker push $IMAGE_ID:master
215240
216241 vm_tests :
242+ needs : basic-checks
217243 runs-on : ubuntu-24.04
218244 steps :
219245 - uses : actions/checkout@v5
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ system=$( nix eval --raw --impure --expr builtins.currentSystem)
6+
7+ echo " ::group::Running pre-commit checks"
8+
9+ if nix build " .#checks.$system .pre-commit" -L; then
10+ echo " ::endgroup::"
11+ exit 0
12+ fi
13+
14+ echo " ::error ::Changes do not pass pre-commit checks"
15+
16+ cat << EOF
17+ The code isn't formatted or doesn't pass lints. You can run pre-commit locally with:
18+
19+ nix develop -c ./maintainers/format.sh
20+ EOF
21+
22+ echo " ::endgroup::"
23+
24+ exit 1
You can’t perform that action at this time.
0 commit comments