@@ -42,11 +42,14 @@ jobs:
4242 needs_rust : true
4343 - check : sort
4444 needs_rust : true
45+ install : cargo install cargo-sort --version 2.0.2 --locked
4546 - check : udeps
4647 needs_rust : true
4748 needs_rust_nightly : true
49+ install : cargo install cargo-udeps --version 0.1.57 --locked
4850 - check : dylint
4951 needs_rust : true
52+ install : cargo install cargo-dylint dylint-link --version 5.0.0 --locked
5053 - check : doc
5154 needs_rust : true
5255 - check : prettier
@@ -97,32 +100,20 @@ jobs:
97100 if : matrix.needs_rust
98101 uses : Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
99102
100- # Cache cargo-run-bin's built tools (.bin) separately from rust-cache. The
101- # tools depend only on their pinned versions (Cargo.toml) and the toolchain,
102- # not on Cargo.lock, so this key avoids rust-cache's lockfile rotation. Keyed
103- # per check so each one caches only the tools it builds, with no contention
104- # (rust-cache keys all matrix checks under one shared job-based key).
105- - name : Cache cargo-run-bin tools
106- if : matrix.needs_rust
107- uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
108- with :
109- path : .bin
110- key : cargo-bin-${{ runner.os }}-${{ matrix.check }}-${{ hashFiles('Cargo.toml', 'rust-toolchain.toml') }}
111- restore-keys : |
112- cargo-bin-${{ runner.os }}-${{ matrix.check }}-
103+ - name : Install per-check cargo tool
104+ if : matrix.install
105+ run : ${{ matrix.install }}
113106
114- - name : Install cargo-run-bin
115- if : matrix.needs_rust
116- run : cargo install cargo-run-bin --locked --version 1.7.4
107+ - name : Install clippy-sarif and sarif-fmt
108+ if : matrix.check == 'clippy'
109+ run : cargo install clippy-sarif sarif-fmt --locked --git https://github.com/psastras/sarif-rs.git --rev 11c33a53f6ffeaed736856b86fb6b7b09fabdfd8
117110
118111 - name : Run clippy with SARIF output
119112 if : matrix.check == 'clippy'
120- # Pass `-D warnings` to clippy directly rather than via RUSTFLAGS so the
121- # deny level applies only to the linted crates, not to the from-source
122- # builds of clippy-sarif/sarif-fmt that `cargo bin` triggers in this step
123- # (some of their transitive deps emit warnings we don't control).
124- run : cargo clippy --all-features --all-targets --message-format=json -- -D warnings |
125- cargo bin clippy-sarif | tee clippy_result.sarif | cargo bin sarif-fmt
113+ env :
114+ RUSTFLAGS : " -D warnings"
115+ run : cargo clippy --all-features --all-targets --message-format=json |
116+ clippy-sarif | tee clippy_result.sarif | sarif-fmt
126117
127118 - name : Upload clippy results to GitHub
128119 if : matrix.check == 'clippy'
0 commit comments