Skip to content

Commit d587884

Browse files
committed
Auto merge of #17235 - Veykril:metrics-caching, r=Veykril
internal: Use Swatinem/rust-cache for metrics CI Current metrics caching uses a base cache action, whereas I think the one we use for general ci works here as well. Saw this while noticing that our metrics CI is broken as it for some reason uses an outdated rust stable? (unsure why that is)
2 parents f915c94 + 2e0f2a2 commit d587884

File tree

2 files changed

+14
-31
lines changed

2 files changed

+14
-31
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ 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'
7171
run: echo "::add-matcher::.github/rust.json"
7272

7373
- name: Cache Dependencies
74-
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
74+
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
7575
with:
7676
key: ${{ env.RUST_CHANNEL }}
7777

@@ -140,7 +140,7 @@ jobs:
140140
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
141141
142142
- name: Cache Dependencies
143-
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
143+
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
144144

145145
- name: Check
146146
run: |

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

+11-28
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)