Duplicated cache due to concurrency
Misc
When running multiple runs at the same time, the cache is duplicated due to concurrency, even with the same key and for the same branch:
Version: cache@v4 Step:
- name: Cache
uses: actions/cache@v4
id: cache
with:
key: venv-${{ runner.os }}-${{ runner.arch }}-pip-${{ hashFiles(format('acceptance/{0}', inputs.file)) }}
path: ${{ steps.cache-dir.outputs.dir }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-pip-
I am facing same issue with the following configuration
uses: actions/cache@v4
id: node_modules
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}
I am facing same issue with the following configuration
uses: actions/cache@v4 id: node_modules with: path: | **/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}![]()
You have one for each ref. I think that this is the expected result. The problem is when a cache is duplicated for the same hash and the same ref.
I am facing same issue with the following configuration
uses: actions/cache@v4 id: node_modules with: path: | **/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}![]()
You have one for each ref. I think that this is the expected result. The problem is when a cache is duplicated for the same hash and the same ref.
Ah sorry you are right, I was expecting the case to be used if the key is same regardless of the ref
More examples: