Skip to content

Commit 7ccbb00

Browse files
author
RishavTiwari25
committed
ci: include rust toolchain version in cargo cache keys
1 parent be4cde4 commit 7ccbb00

File tree

7 files changed

+75
-15
lines changed

7 files changed

+75
-15
lines changed

.github/workflows/nightly_build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ jobs:
4040
toolchain: stable
4141
targets: ${{ matrix.target }}
4242

43+
- name: Get rust_version
44+
id: rust_version
45+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
46+
4347
- name: Restore cache
4448
id: cache
4549
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
@@ -48,7 +52,7 @@ jobs:
4852
~/.cargo/registry
4953
~/.cargo/git
5054
target
51-
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
55+
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
5256

5357
- name: Build
5458
run: cargo build --target ${{ matrix.target }} --release --locked --bin boa

.github/workflows/pull_request.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ jobs:
3131
with:
3232
toolchain: stable
3333

34+
- name: Get rust_version
35+
id: rust_version
36+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
37+
3438
- name: Cache cargo
3539
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
3640
with:
3741
path: |
3842
target
3943
~/.cargo/git
4044
~/.cargo/registry
41-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
45+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
4246
- uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
4347
with:
4448
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,18 @@ jobs:
123123
toolchain: stable
124124
targets: ${{ matrix.target }}
125125

126+
- name: Get rust_version
127+
id: rust_version
128+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
129+
126130
- name: Cache cargo
127131
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
128132
with:
129133
path: |
130134
target
131135
~/.cargo/git
132136
~/.cargo/registry
133-
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
137+
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
134138

135139
- name: Build
136140
run: cargo build --target ${{ matrix.target }} --verbose --release --locked --bin boa

.github/workflows/rust.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,18 @@ jobs:
8080
toolchain: stable
8181
components: clippy
8282

83+
- name: Get rust_version
84+
id: rust_version
85+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
86+
8387
- name: Cache cargo
8488
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
8589
with:
8690
path: |
8791
target
8892
~/.cargo/git
8993
~/.cargo/registry
90-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
94+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
9195

9296
- name: Install cargo-workspaces
9397
run: cargo install cargo-workspaces
@@ -124,14 +128,18 @@ jobs:
124128
with:
125129
toolchain: stable
126130

131+
- name: Get rust_version
132+
id: rust_version
133+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
134+
127135
- name: Cache cargo
128136
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
129137
with:
130138
path: |
131139
target
132140
~/.cargo/git
133141
~/.cargo/registry
134-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
142+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
135143

136144
- name: Generate documentation
137145
run: cargo doc -v --document-private-items --all-features
@@ -190,14 +198,18 @@ jobs:
190198
- name: Install Rust toolchain
191199
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
192200

201+
- name: Get rust_version
202+
id: rust_version
203+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
204+
193205
- name: Cache cargo
194206
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
195207
with:
196208
path: |
197209
target
198210
~/.cargo/git
199211
~/.cargo/registry
200-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
212+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
201213

202214
- name: Install cargo-tarpaulin
203215
uses: baptiste0928/cargo-install@f204293d9709061b7bc1756fec3ec4e2cd57dec0 # v3.4.0
@@ -258,14 +270,18 @@ jobs:
258270
- name: Install Cargo insta
259271
run: cargo install --locked cargo-insta
260272

273+
- name: Get rust_version
274+
id: rust_version
275+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
276+
261277
- name: Cache cargo
262278
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
263279
with:
264280
path: |
265281
target
266282
~/.cargo/git
267283
~/.cargo/registry
268-
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
284+
key: ${{ matrix.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
269285

270286
- name: Build tests
271287
run: cargo test --no-run --profile ci
@@ -321,14 +337,18 @@ jobs:
321337
crate: cross
322338
git: https://github.com/cross-rs/cross
323339

340+
- name: Get rust_version
341+
id: rust_version
342+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
343+
324344
- name: Cache cargo
325345
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
326346
with:
327347
path: |
328348
target
329349
~/.cargo/git
330350
~/.cargo/registry
331-
key: ${{ matrix.target }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
351+
key: ${{ matrix.target }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
332352

333353
- name: Run tests
334354
run: |
@@ -366,14 +386,18 @@ jobs:
366386
with:
367387
components: miri
368388

389+
- name: Get rust_version
390+
id: rust_version
391+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
392+
369393
- name: Cache cargo
370394
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
371395
with:
372396
path: |
373397
target
374398
~/.cargo/git
375399
~/.cargo/registry
376-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-miri-${{ hashFiles('**/Cargo.lock') }}
400+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-miri-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
377401

378402
- name: Setup miri
379403
run: cargo miri setup
@@ -406,14 +430,18 @@ jobs:
406430
with:
407431
toolchain: stable
408432

433+
- name: Get rust_version
434+
id: rust_version
435+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
436+
409437
- name: Cache cargo
410438
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
411439
with:
412440
path: |
413441
target
414442
~/.cargo/git
415443
~/.cargo/registry
416-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
444+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
417445

418446
- name: Install cargo-fuzz
419447
run: cargo install cargo-fuzz
@@ -446,14 +474,18 @@ jobs:
446474
with:
447475
toolchain: stable
448476

477+
- name: Get rust_version
478+
id: rust_version
479+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
480+
449481
- name: Cache cargo
450482
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
451483
with:
452484
path: |
453485
target
454486
~/.cargo/git
455487
~/.cargo/registry
456-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
488+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
457489

458490
- name: Install cargo-workspaces
459491
run: cargo install cargo-workspaces
@@ -490,14 +522,18 @@ jobs:
490522
with:
491523
persist-credentials: false
492524

525+
- name: Get rust_version
526+
id: rust_version
527+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
528+
493529
- name: Cache cargo
494530
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
495531
with:
496532
path: |
497533
~/.cargo/registry
498534
~/.cargo/git
499535
target
500-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
536+
key: ${{ runner.os }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
501537

502538
- name: Check Semver
503539
uses: obi1kenobi/cargo-semver-checks-action@5b298c9520f7096a4683c0bd981a7ac5a7e249ae # v2

.github/workflows/test262.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ jobs:
3030
with:
3131
toolchain: stable
3232

33+
- name: Get rust_version
34+
id: rust_version
35+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
36+
3337
- name: Cache cargo
3438
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
3539
with:
3640
path: |
3741
boa/target
3842
~/.cargo/git
3943
~/.cargo/registry
40-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
44+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
4145

4246
- name: Checkout the data repo
4347
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

.github/workflows/test262_release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ jobs:
3434
toolchain: stable
3535

3636
# Cache cargo dependencies
37+
- name: Get rust_version
38+
id: rust_version
39+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
40+
3741
- name: Cache cargo
3842
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
3943
with:
4044
path: |
4145
target
4246
~/.cargo/git
4347
~/.cargo/registry
44-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
48+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
4549

4650
# Checkout the `data` repository
4751
- name: Checkout the data repo

.github/workflows/webassembly.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ jobs:
5757
toolchain: stable
5858

5959

60+
- name: Get rust_version
61+
id: rust_version
62+
run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT
63+
6064
- name: Cache cargo
6165
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
6266
with:
6367
path: |
6468
target
6569
~/.cargo/git
6670
~/.cargo/registry
67-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
71+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
6872

6973
- name: Install wasm-pack
7074
uses: baptiste0928/cargo-install@f204293d9709061b7bc1756fec3ec4e2cd57dec0 # v3.4.0

0 commit comments

Comments
 (0)