Skip to content

Commit 1392e07

Browse files
committed
CI: use key-restore for cache GH action
It seems one can't overwrite a cache entry: ``` Failed to save: Unable to reserve cache with key linkcheck--0.8.1, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/master, Key: linkcheck--0.8.1, Version: 33f8fd511bed9c91c40778bc5c27cb58425caa894ab50f9c5705d83cb78660e0 Warning: Cache save failed. ``` A proper solution is to use `restore-keys`: https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
1 parent bda5664 commit 1392e07

File tree

1 file changed

+4
-2
lines changed
  • src/doc/rustc-dev-guide/.github/workflows

1 file changed

+4
-2
lines changed

src/doc/rustc-dev-guide/.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
uses: actions/cache/restore@v4
4242
with:
4343
path: book/linkcheck/cache.json
44-
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}
44+
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}
45+
restore-keys: |
46+
linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--
4547
4648
- name: Install latest nightly Rust toolchain
4749
if: steps.mdbook-cache.outputs.cache-hit != 'true'
@@ -66,7 +68,7 @@ jobs:
6668
uses: actions/cache/save@v4
6769
with:
6870
path: book/linkcheck/cache.json
69-
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}
71+
key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}
7072

7173
- name: Deploy to gh-pages
7274
if: github.event_name == 'push'

0 commit comments

Comments
 (0)