From c9a35614dee9003fd3217911633fb4022d0e347b Mon Sep 17 00:00:00 2001 From: Jonas Platte <158304798+svix-jplatte@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:21:08 +0100 Subject: [PATCH] ci: Set custom prefix names for Rust caches (#1243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … to be able to tell caches apart easily in the web UI. --- .github/workflows/bridge-ci.yml | 2 ++ .github/workflows/rust-lint.yml | 2 ++ .github/workflows/rust-release.yml | 2 ++ .github/workflows/server-ci.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/bridge-ci.yml b/.github/workflows/bridge-ci.yml index 8561e59e3..54e7c5545 100644 --- a/.github/workflows/bridge-ci.yml +++ b/.github/workflows/bridge-ci.yml @@ -42,6 +42,8 @@ jobs: # only save the cache on the main branch # cf https://github.com/Swatinem/rust-cache/issues/95 save-if: ${{ github.ref == 'refs/heads/main' }} + # include relevant information in the cache name + prefix-key: "bridge-${{ matrix.rust }}" - name: rustfmt run: cargo fmt -- --check diff --git a/.github/workflows/rust-lint.yml b/.github/workflows/rust-lint.yml index f86bdb241..8410a2b08 100644 --- a/.github/workflows/rust-lint.yml +++ b/.github/workflows/rust-lint.yml @@ -49,6 +49,8 @@ jobs: # only save the cache on the main branch # cf https://github.com/Swatinem/rust-cache/issues/95 save-if: ${{ github.ref == 'refs/heads/main' }} + # include relevant information in the cache name + prefix-key: "rust-client-${{ matrix.rust }}" - name: Clippy run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 0c25b459b..f0c5bd281 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -36,6 +36,8 @@ jobs: workspaces: "rust -> target" # only restore cache for faster publishing, don't save back results save-if: false + # use the cache from rust-lint/stable + prefix-key: "rust-client-stable" - name: Publish env: diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 32089dd5f..cfb1476df 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -42,6 +42,8 @@ jobs: # only save the cache on the main branch # cf https://github.com/Swatinem/rust-cache/issues/95 save-if: ${{ github.ref == 'refs/heads/main' }} + # include relevant information in the cache name + prefix-key: "server-${{ matrix.rust }}" - name: rustfmt run: cargo fmt -- --check