Skip to content

Commit

Permalink
Merge pull request #2323 from input-output-hk/djo/ci/simplify-rust-ca…
Browse files Browse the repository at this point in the history
…che-key

refactor(ci): use cache-version instead of 'v0-' in rust cache key prefix
  • Loading branch information
Alenar authored Feb 20, 2025
2 parents 01e15ab + 7812d29 commit fc119af
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions/toolchain-and-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down

0 comments on commit fc119af

Please sign in to comment.