Skip to content

Commit 4b2998d

Browse files
committed
Use Swatinem/rust-cache for metrics CI
1 parent dd0ea02 commit 4b2998d

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

src/tools/rust-analyzer/.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
- name: Install Rust toolchain
6464
run: |
6565
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
66-
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
6766
rustup default ${{ env.RUST_CHANNEL }}
67+
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
6868
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
6969
- name: Install Rust Problem Matcher
7070
if: matrix.os == 'ubuntu-latest'

src/tools/rust-analyzer/.github/workflows/metrics.yaml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ jobs:
1818
- name: Install Rust toolchain
1919
run: |
2020
rustup update --no-self-update stable
21-
rustup component add rustfmt rust-src
2221
rustup default stable
22+
rustup component add --toolchain stable rustfmt rust-src
23+
2324
- name: Cache cargo
24-
uses: actions/cache@v4
25+
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
2526
with:
26-
path: |
27-
~/.cargo/bin/
28-
~/.cargo/registry/index/
29-
~/.cargo/registry/cache/
30-
~/.cargo/git/db/
3127
key: ${{ runner.os }}-cargo-${{ github.sha }}
28+
cache-targets: "false"
3229

3330
build_metrics:
3431
runs-on: ubuntu-latest
@@ -39,23 +36,19 @@ jobs:
3936
uses: actions/checkout@v4
4037

4138
- name: Restore cargo cache
42-
uses: actions/cache@v4
39+
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
4340
with:
44-
path: |
45-
~/.cargo/bin/
46-
~/.cargo/registry/index/
47-
~/.cargo/registry/cache/
48-
~/.cargo/git/db/
4941
key: ${{ runner.os }}-cargo-${{ github.sha }}
42+
cache-targets: "false"
5043

5144
- name: Collect build metrics
5245
run: cargo xtask metrics build
5346

5447
- name: Cache target
55-
uses: actions/cache@v4
48+
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
5649
with:
57-
path: target/
58-
key: ${{ runner.os }}-target-${{ github.sha }}
50+
key: ${{ runner.os }}-cargo-${{ github.sha }}
51+
cache-targets: "true"
5952

6053
- name: Upload build metrics
6154
uses: actions/upload-artifact@v4
@@ -76,20 +69,10 @@ jobs:
7669
uses: actions/checkout@v4
7770

7871
- name: Restore cargo cache
79-
uses: actions/cache@v4
72+
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
8073
with:
81-
path: |
82-
~/.cargo/bin/
83-
~/.cargo/registry/index/
84-
~/.cargo/registry/cache/
85-
~/.cargo/git/db/
8674
key: ${{ runner.os }}-cargo-${{ github.sha }}
87-
88-
- name: Restore target cache
89-
uses: actions/cache@v4
90-
with:
91-
path: target/
92-
key: ${{ runner.os }}-target-${{ github.sha }}
75+
cache-targets: "true"
9376

9477
- name: Collect metrics
9578
run: cargo xtask metrics "${{ matrix.names }}"

0 commit comments

Comments
 (0)