4747 workflows:
4848 - '.github/workflows/**'
4949
50- # Quick checks first - fail fast
50+ # Format check (nightly for Edition 2024)
51+ fmt :
52+ name : Format
53+ needs : changes
54+ if : needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
55+ runs-on : ubuntu-latest
56+ timeout-minutes : 5
57+ steps :
58+ - uses : actions/checkout@v4
59+
60+ - name : Install Rust nightly
61+ uses : dtolnay/rust-toolchain@nightly
62+ with :
63+ components : rustfmt
64+
65+ - name : Check formatting
66+ run : cargo fmt --all -- --check
67+
68+ # Clippy and docs (stable)
5169 check :
5270 name : Check
5371 needs : changes
@@ -60,43 +78,17 @@ jobs:
6078 - name : Install Rust stable
6179 uses : dtolnay/rust-toolchain@stable
6280 with :
63- components : rustfmt, clippy
64-
65- - name : Install Rust nightly (for Edition 2024 formatting)
66- uses : dtolnay/rust-toolchain@nightly
67- with :
68- components : rustfmt
81+ components : clippy
6982
7083 - name : Cache Cargo
7184 uses : Swatinem/rust-cache@v2
7285 with :
7386 shared-key : " check"
7487 save-if : ${{ github.ref == 'refs/heads/main' }}
7588
76- - name : Check formatting (nightly for Edition 2024)
77- run : cargo +nightly fmt --all -- --check
78-
7989 - name : Clippy
8090 run : cargo clippy --workspace --all-targets --all-features -- -D warnings
8191
82- - name : Install cargo-binstall
83- uses : cargo-bins/cargo-binstall@main
84-
85- - name : Install SARIF tools
86- run : cargo binstall --no-confirm clippy-sarif sarif-fmt
87-
88- - name : Clippy SARIF (for GitHub PR integration)
89- run : |
90- cargo clippy --workspace --all-targets --all-features --message-format=json -- -D warnings | \
91- clippy-sarif | tee clippy-results.sarif | sarif-fmt
92- continue-on-error : true
93-
94- - name : Upload SARIF results to GitHub
95- uses : github/codeql-action/upload-sarif@v3
96- with :
97- sarif_file : clippy-results.sarif
98- wait-for-processing : true
99-
10092 - name : Check documentation
10193 run : cargo doc --workspace --no-deps --all-features
10294 env :
@@ -140,7 +132,7 @@ jobs:
140132 # Cross-platform tests with matrix
141133 test :
142134 name : Test (${{ matrix.os }})
143- needs : [changes, check]
135+ needs : [changes, fmt, check]
144136 if : needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
145137 runs-on : ${{ matrix.os }}
146138 timeout-minutes : 30
@@ -213,7 +205,7 @@ jobs:
213205 # Code coverage (Linux only for speed)
214206 coverage :
215207 name : Code Coverage
216- needs : [changes, check]
208+ needs : [changes, fmt, check]
217209 if : needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
218210 runs-on : ubuntu-latest
219211 timeout-minutes : 20
@@ -259,7 +251,7 @@ jobs:
259251 # MSRV check
260252 msrv :
261253 name : Check MSRV
262- needs : [changes, check]
254+ needs : [changes, fmt, check]
263255 if : needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
264256 runs-on : ubuntu-latest
265257 timeout-minutes : 15
@@ -288,7 +280,7 @@ jobs:
288280 # WASM build check for Zed extension
289281 wasm :
290282 name : WASM Build (Zed Extension)
291- needs : [changes, check]
283+ needs : [changes, fmt, check]
292284 if : needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
293285 runs-on : ubuntu-latest
294286 timeout-minutes : 15
@@ -377,7 +369,7 @@ jobs:
377369 # All checks passed
378370 ci-success :
379371 name : CI Success
380- needs : [changes, check, security, test, coverage, msrv, wasm]
372+ needs : [changes, fmt, check, security, test, coverage, msrv, wasm]
381373 runs-on : ubuntu-latest
382374 if : always()
383375 steps :
@@ -401,6 +393,7 @@ jobs:
401393 }
402394
403395 failed=0
396+ check_job "${{ needs.fmt.result }}" "fmt" || failed=1
404397 check_job "${{ needs.check.result }}" "check" || failed=1
405398 check_job "${{ needs.security.result }}" "security" || failed=1
406399 check_job "${{ needs.test.result }}" "test" || failed=1
0 commit comments