From c190b084d9c1f8e727712b13671d7cacdae69547 Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:48:09 +0100 Subject: [PATCH 1/2] refactor(ci): use cache-version instead of 'v0-' in rust cache key prefix --- .github/workflows/actions/toolchain-and-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/toolchain-and-cache/action.yml b/.github/workflows/actions/toolchain-and-cache/action.yml index 7827205f789..b3c3982a261 100644 --- a/.github/workflows/actions/toolchain-and-cache/action.yml +++ b/.github/workflows/actions/toolchain-and-cache/action.yml @@ -26,7 +26,7 @@ runs: with: # only save the cache on the main branch to limit github actions total cache size save-if: ${{ github.ref == 'refs/heads/main' }} - key: ${{ runner.os }}-cache-v${{ inputs.cache-version }} + prefix-key: v${{ inputs.cache-version }}-rust-${{ runner.os }} - name: Install cargo tools installer uses: taiki-e/install-action@v2 From 7812d29dc7e283af311665e3ed0f75099a28bb0b Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Thu, 20 Feb 2025 13:06:56 +0100 Subject: [PATCH 2/2] refactor(ci): use a repository var instead of a secret for cache version Since it's not a sensible data and this avoid obfuscations of occurences of the cache version value in CI logs. --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/manual-publish-npm.yml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 977ad8b5d06..bb8ce52d32f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: 22.04-${{ secrets.CACHE_VERSION }} + cache-version: 22.04-${{ vars.CACHE_VERSION }} cargo-tools: cargo-deb github-token: ${{ secrets.GITHUB_TOKEN }} @@ -97,7 +97,7 @@ jobs: - name: Install stable toolchain and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }} + cache-version: ${{ vars.CACHE_VERSION }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Mithril workspace & publish artifacts @@ -121,7 +121,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }}-wasm + cache-version: ${{ vars.CACHE_VERSION }}-wasm cargo-tools: wasm-pack github-token: ${{ secrets.GITHUB_TOKEN }} @@ -193,7 +193,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }} + cache-version: ${{ vars.CACHE_VERSION }} cargo-tools: cargo-nextest github-token: ${{ secrets.GITHUB_TOKEN }} @@ -231,7 +231,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }} + cache-version: ${{ vars.CACHE_VERSION }} cargo-tools: cargo-machete cargo-sort clippy-sarif sarif-fmt github-token: ${{ secrets.GITHUB_TOKEN }} @@ -532,7 +532,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }}-wasm + cache-version: ${{ vars.CACHE_VERSION }}-wasm cargo-tools: wasm-pack github-token: ${{ secrets.GITHUB_TOKEN }} @@ -739,7 +739,7 @@ jobs: - name: Install stable toolchain and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }} + cache-version: ${{ vars.CACHE_VERSION }} cargo-tools: clippy-sarif sarif-fmt github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/manual-publish-npm.yml b/.github/workflows/manual-publish-npm.yml index d8464dc5708..bcd22ba932d 100644 --- a/.github/workflows/manual-publish-npm.yml +++ b/.github/workflows/manual-publish-npm.yml @@ -56,7 +56,7 @@ jobs: if: inputs.package == matrix.package || inputs.package == 'all' uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }}-wasm + cache-version: ${{ vars.CACHE_VERSION }}-wasm cargo-tools: wasm-pack github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c58e09b6ee2..51c765f6866 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -285,7 +285,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }}-wasm + cache-version: ${{ vars.CACHE_VERSION }}-wasm cargo-tools: wasm-pack github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fbc3c8d448..7d412bfb421 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -233,7 +233,7 @@ jobs: - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: - cache-version: ${{ secrets.CACHE_VERSION }}-wasm + cache-version: ${{ vars.CACHE_VERSION }}-wasm cargo-tools: wasm-pack github-token: ${{ secrets.GITHUB_TOKEN }}