3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-07-07 15:26:19 +00:00

Fix Windows cache path validation after Rollup migration (#355)

This commit is contained in:
eitsupi 2026-07-04 17:11:26 +09:00 committed by GitHub
parent 6dfd3c5062
commit a31add9f17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 297 additions and 2398 deletions

70
.github/workflows/save-restore.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: save-restore
on: [push, pull_request]
permissions: {}
jobs:
save:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Save a new cache on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update
# Use a per-run key so this job always exercises the post-step save path.
- uses: ./
with:
workspaces: tests
shared-key: save-restore-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
- run: cargo check
working-directory: tests
restore:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Restore the newly saved cache on ${{ matrix.os }}
needs: save
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update
- id: cache
uses: ./
with:
workspaces: tests
shared-key: save-restore-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
save-if: "false"
- name: Verify exact cache hit
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
echo "The cache created by the save job could not be restored." >&2
exit 1