about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-15 09:36:33 +0000
committerbors <bors@rust-lang.org>2024-05-15 09:36:33 +0000
commitd5878844a82ac87142b509a2444d2b1c1a8e80bf (patch)
tree7c7abf2a51db5514647809d5c61f5addc1a2f73f
parentf915c94f388171dedfc515bdbb77cda72f4d2a2c (diff)
parent2e0f2a23a4574b9995134b4e2fcd001a6787d3d8 (diff)
downloadrust-d5878844a82ac87142b509a2444d2b1c1a8e80bf.tar.gz
rust-d5878844a82ac87142b509a2444d2b1c1a8e80bf.zip
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)
-rw-r--r--src/tools/rust-analyzer/.github/workflows/ci.yaml6
-rw-r--r--src/tools/rust-analyzer/.github/workflows/metrics.yaml39
2 files changed, 14 insertions, 31 deletions
diff --git a/src/tools/rust-analyzer/.github/workflows/ci.yaml b/src/tools/rust-analyzer/.github/workflows/ci.yaml
index a10345a7060..87a1729d2b4 100644
--- a/src/tools/rust-analyzer/.github/workflows/ci.yaml
+++ b/src/tools/rust-analyzer/.github/workflows/ci.yaml
@@ -63,15 +63,15 @@ jobs:
       - name: Install Rust toolchain
         run: |
           rustup update --no-self-update ${{ env.RUST_CHANNEL }}
-          rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
           rustup default ${{ env.RUST_CHANNEL }}
+          rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
       # https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
       - name: Install Rust Problem Matcher
         if: matrix.os == 'ubuntu-latest'
         run: echo "::add-matcher::.github/rust.json"
 
       - name: Cache Dependencies
-        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
+        uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
         with:
           key: ${{ env.RUST_CHANNEL }}
 
@@ -140,7 +140,7 @@ jobs:
           rustup target add ${{ env.targets }} ${{ env.targets_ide }}
 
       - name: Cache Dependencies
-        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
+        uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
 
       - name: Check
         run: |
diff --git a/src/tools/rust-analyzer/.github/workflows/metrics.yaml b/src/tools/rust-analyzer/.github/workflows/metrics.yaml
index b6cd4a795a8..377a6898ec0 100644
--- a/src/tools/rust-analyzer/.github/workflows/metrics.yaml
+++ b/src/tools/rust-analyzer/.github/workflows/metrics.yaml
@@ -18,17 +18,14 @@ jobs:
       - name: Install Rust toolchain
         run: |
           rustup update --no-self-update stable
-          rustup component add rustfmt rust-src
           rustup default stable
+          rustup component add --toolchain stable rustfmt rust-src
+
       - name: Cache cargo
-        uses: actions/cache@v4
+        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
         with:
-          path: |
-            ~/.cargo/bin/
-            ~/.cargo/registry/index/
-            ~/.cargo/registry/cache/
-            ~/.cargo/git/db/
           key: ${{ runner.os }}-cargo-${{ github.sha }}
+          cache-targets: "false"
 
   build_metrics:
     runs-on: ubuntu-latest
@@ -39,23 +36,19 @@ jobs:
         uses: actions/checkout@v4
 
       - name: Restore cargo cache
-        uses: actions/cache@v4
+        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
         with:
-          path: |
-            ~/.cargo/bin/
-            ~/.cargo/registry/index/
-            ~/.cargo/registry/cache/
-            ~/.cargo/git/db/
           key: ${{ runner.os }}-cargo-${{ github.sha }}
+          cache-targets: "false"
 
       - name: Collect build metrics
         run: cargo xtask metrics build
 
       - name: Cache target
-        uses: actions/cache@v4
+        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
         with:
-          path: target/
-          key: ${{ runner.os }}-target-${{ github.sha }}
+          key: ${{ runner.os }}-cargo-${{ github.sha }}
+          cache-targets: "true"
 
       - name: Upload build metrics
         uses: actions/upload-artifact@v4
@@ -76,20 +69,10 @@ jobs:
         uses: actions/checkout@v4
 
       - name: Restore cargo cache
-        uses: actions/cache@v4
+        uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
         with:
-          path: |
-            ~/.cargo/bin/
-            ~/.cargo/registry/index/
-            ~/.cargo/registry/cache/
-            ~/.cargo/git/db/
           key: ${{ runner.os }}-cargo-${{ github.sha }}
-
-      - name: Restore target cache
-        uses: actions/cache@v4
-        with:
-          path: target/
-          key: ${{ runner.os }}-target-${{ github.sha }}
+          cache-targets: "true"
 
       - name: Collect metrics
         run: cargo xtask metrics "${{ matrix.names }}"