|
15 | 15 | CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
16 | 16 | # Incremental compilation off for CI (more reproducible, better caching) |
17 | 17 | CARGO_INCREMENTAL: 0 |
18 | | - # Use sccache for shared compilation cache |
19 | | - SCCACHE_GHA_ENABLED: "true" |
20 | | - RUSTC_WRAPPER: "sccache" |
21 | 18 |
|
22 | 19 | # Ensure only one CI run per branch at a time |
23 | 20 | concurrency: |
@@ -75,28 +72,11 @@ jobs: |
75 | 72 | with: |
76 | 73 | components: clippy |
77 | 74 |
|
78 | | - - name: Setup sccache |
79 | | - uses: mozilla-actions/sccache-action@v0.0.6 |
80 | | - |
81 | | - - name: Cache cargo registry & git |
82 | | - uses: actions/cache@v4 |
83 | | - with: |
84 | | - path: | |
85 | | - ~/.cargo/registry/index/ |
86 | | - ~/.cargo/registry/cache/ |
87 | | - ~/.cargo/git/db/ |
88 | | - key: cargo-registry-${{ needs.setup-cache.outputs.cache-key }} |
89 | | - restore-keys: | |
90 | | - cargo-registry- |
91 | | - |
92 | | - - name: Cache cargo build |
93 | | - uses: actions/cache@v4 |
| 75 | + - name: Setup Rust cache |
| 76 | + uses: Swatinem/rust-cache@v2 |
94 | 77 | with: |
95 | | - path: target/ |
96 | | - key: cargo-build-clippy-${{ runner.os }}-${{ needs.setup-cache.outputs.cache-key }} |
97 | | - restore-keys: | |
98 | | - cargo-build-clippy-${{ runner.os }}- |
99 | | - cargo-build-${{ runner.os }}- |
| 78 | + prefix-key: "rust-clippy" |
| 79 | + shared-key: ${{ needs.setup-cache.outputs.cache-key }} |
100 | 80 |
|
101 | 81 | - name: Run clippy |
102 | 82 | run: cargo +nightly clippy --workspace --all-targets --all-features --exclude cortex-gui -- -D warnings |
@@ -130,28 +110,11 @@ jobs: |
130 | 110 | - name: Install Rust nightly |
131 | 111 | uses: dtolnay/rust-toolchain@nightly |
132 | 112 |
|
133 | | - - name: Setup sccache |
134 | | - uses: mozilla-actions/sccache-action@v0.0.6 |
135 | | - |
136 | | - - name: Cache cargo registry & git |
137 | | - uses: actions/cache@v4 |
138 | | - with: |
139 | | - path: | |
140 | | - ~/.cargo/registry/index/ |
141 | | - ~/.cargo/registry/cache/ |
142 | | - ~/.cargo/git/db/ |
143 | | - key: cargo-registry-${{ needs.setup-cache.outputs.cache-key }} |
144 | | - restore-keys: | |
145 | | - cargo-registry- |
146 | | - |
147 | | - - name: Cache cargo build |
148 | | - uses: actions/cache@v4 |
| 113 | + - name: Setup Rust cache |
| 114 | + uses: Swatinem/rust-cache@v2 |
149 | 115 | with: |
150 | | - path: target/ |
151 | | - key: cargo-build-test-${{ matrix.name }}-${{ needs.setup-cache.outputs.cache-key }} |
152 | | - restore-keys: | |
153 | | - cargo-build-test-${{ matrix.name }}- |
154 | | - cargo-build-${{ matrix.name }}- |
| 116 | + prefix-key: "rust-test-${{ matrix.name }}" |
| 117 | + shared-key: ${{ needs.setup-cache.outputs.cache-key }} |
155 | 118 |
|
156 | 119 | - name: Run tests |
157 | 120 | run: cargo +nightly test --workspace --all-features --exclude cortex-gui |
@@ -187,28 +150,11 @@ jobs: |
187 | 150 | - name: Install Rust nightly |
188 | 151 | uses: dtolnay/rust-toolchain@nightly |
189 | 152 |
|
190 | | - - name: Setup sccache |
191 | | - uses: mozilla-actions/sccache-action@v0.0.6 |
192 | | - |
193 | | - - name: Cache cargo registry & git |
194 | | - uses: actions/cache@v4 |
195 | | - with: |
196 | | - path: | |
197 | | - ~/.cargo/registry/index/ |
198 | | - ~/.cargo/registry/cache/ |
199 | | - ~/.cargo/git/db/ |
200 | | - key: cargo-registry-${{ needs.setup-cache.outputs.cache-key }} |
201 | | - restore-keys: | |
202 | | - cargo-registry- |
203 | | - |
204 | | - - name: Cache cargo build |
205 | | - uses: actions/cache@v4 |
| 153 | + - name: Setup Rust cache |
| 154 | + uses: Swatinem/rust-cache@v2 |
206 | 155 | with: |
207 | | - path: target/ |
208 | | - key: cargo-build-check-${{ matrix.name }}-${{ needs.setup-cache.outputs.cache-key }} |
209 | | - restore-keys: | |
210 | | - cargo-build-check-${{ matrix.name }}- |
211 | | - cargo-build-${{ matrix.name }}- |
| 156 | + prefix-key: "rust-build-${{ matrix.name }}" |
| 157 | + shared-key: ${{ needs.setup-cache.outputs.cache-key }} |
212 | 158 |
|
213 | 159 | - name: Check build |
214 | 160 | run: cargo +nightly check --workspace --all-features --exclude cortex-gui |
@@ -268,28 +214,11 @@ jobs: |
268 | 214 | - name: Install Rust nightly |
269 | 215 | uses: dtolnay/rust-toolchain@nightly |
270 | 216 |
|
271 | | - - name: Setup sccache |
272 | | - uses: mozilla-actions/sccache-action@v0.0.6 |
273 | | - |
274 | | - - name: Cache cargo registry & git |
275 | | - uses: actions/cache@v4 |
276 | | - with: |
277 | | - path: | |
278 | | - ~/.cargo/registry/index/ |
279 | | - ~/.cargo/registry/cache/ |
280 | | - ~/.cargo/git/db/ |
281 | | - key: cargo-registry-${{ needs.setup-cache.outputs.cache-key }} |
282 | | - restore-keys: | |
283 | | - cargo-registry- |
284 | | - |
285 | | - - name: Cache cargo build (GUI) |
286 | | - uses: actions/cache@v4 |
| 217 | + - name: Setup Rust cache |
| 218 | + uses: Swatinem/rust-cache@v2 |
287 | 219 | with: |
288 | | - path: target/ |
289 | | - key: cargo-build-gui-${{ matrix.name }}-${{ needs.setup-cache.outputs.cache-key }} |
290 | | - restore-keys: | |
291 | | - cargo-build-gui-${{ matrix.name }}- |
292 | | - cargo-build-${{ matrix.name }}- |
| 220 | + prefix-key: "rust-gui-${{ matrix.name }}" |
| 221 | + shared-key: ${{ needs.setup-cache.outputs.cache-key }} |
293 | 222 |
|
294 | 223 | - name: Check GUI build |
295 | 224 | run: cargo +nightly check -p cortex-gui |
|
0 commit comments