Open
Description
I have made a minimal example of bug.
I have setup a Cargo workspace and want to cache the ~/.cargo
and target
directories. Calling save explicitly at the end of the script does not overwrite the existing cache after the cache is stored on the first time.
Deleting the previous version of the cache fixes it
Run actions/cache/save@v4
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/cargo-ci/cargo-ci --files-from manifest.txt --use-compress-program zstdmt
Failed to save: Unable to reserve cache with key Linux-restore-build, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/main, Key: Linux-restore-build, Version: cd36736238095b30d245e37cee3eada29643d39d68cc49be99ecf89155bdc73a
Warning: Cache save failed.
The core of the message seems to be another job may be creating this cache. More details: Cache already exists.
The YAML workflow file I am using is
name: Rust test workflow
on:
push:
branches:
- 'main'
jobs:
test-restore-build:
name: Test restore compile and store
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update APT package index
run: sudo apt-get update
- name: Install and download required APT packages
run: sudo apt-get install -y rustup
- name: Restore Cargo cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
target
key: ${{ runner.os }}-restore-build
- name: Write to target
run: cargo build
- name: Save Cargo cache
uses: actions/cache/save@v4
with:
path: |
~/.cargo
target
key: ${{ runner.os }}-restore-build
Metadata
Metadata
Assignees
Labels
No labels