You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Using yarn 1, continue getting yarn cache is not found on PRs that have run multiple times.
Weirdly, this works on pull_request but not on push events.
Push:
Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/16.13.2/x64
/usr/local/bin/yarn --version
1.22.17
/usr/local/bin/yarn cache dir
/home/runner/.cache/yarn/v6
yarn cache is not found
Pull request:
Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/16.13.2/x64
/usr/local/bin/yarn --version
1.22.17
/usr/local/bin/yarn cache dir
/home/runner/.cache/yarn/v6
Received 151904393 of 156098697 (97.3%), 144.9 MBs/sec
Received 156098697 of 156098697 (100.0%), 128.6 MBs/sec
Cache Size: ~149 MB (156098697 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/1233a9f5-f0f9-47e9-aaf5-472904875c75/cache.tzst -P -C /home/runner/work/alchemist/alchemist
Cache restored successfully
Cache restored from key: node-cache-Linux-yarn-c29c2173f71392ee46ad40a81d3756710c14774844267556986d4379721c0e46
Hello @mmahalwy. Thank you for your report. Could you please provide a public repository to reproduce the issue or a link to the build with issue. We've tried to reproduce it from our side but it works as expected.
It can be related to the constant updating of the yarn.lock file, because the yarn install command can update dependencies. It updates the yarn.lock file and regenerate hash.
Hello @mmahalwy. For now I'm going to close the issue because I've tried to reproduce the issue but it works as expected. If you get any additional information feel free to ping us.
Something that was not at all clear to me and is not explicitly mentioned anywhere in the documentation, is that when a cache search misses, the cache action evaluates the paths to subsequently store at the end of the job. I was confused why every example didn't have two uses of the cache action (1 to try to restore and then 1 to store after generating the files only if the cache missed), since the docs make it sound like the cache stores when the action is used, not at the end. It's somewhat implied by the cache only storing files if the job was successful but it could be more explicit.
Activity
dmitry-shibanov commentedon Jan 25, 2022
Hello @mmahalwy. Thank you for your report. Could you please provide a public repository to reproduce the issue or a link to the build with issue. We've tried to reproduce it from our side but it works as expected.
mmahalwy commentedon Jan 25, 2022
its sadly a private repo :(
dmitry-shibanov commentedon Jan 26, 2022
Hello @mmahalwy. I can suppose two things:
yarn installcommand can update dependencies. It updates theyarn.lockfile and regenerate hash.dmitry-shibanov commentedon Feb 7, 2022
Hello @mmahalwy. For now I'm going to close the issue because I've tried to reproduce the issue but it works as expected. If you get any additional information feel free to ping us.
mmahalwy commentedon Feb 7, 2022
ty
tom-spalding commentedon Jul 13, 2023
I have this issue as well
djohts commentedon Jul 18, 2023
Having this issue too: first run, second run
tom-spalding commentedon Jul 19, 2023
Here is something we can test @djohts. According to this answer https://stackoverflow.com/questions/55110729/how-do-i-cache-steps-in-github-actions/57958803#comment126885415_57958803 we might need to cache a second time in case of a miss.
n0099 commentedon Feb 12, 2024
https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/action.yml#L40
actions/cache#1315
https://stackoverflow.com/a/75961093/12576620
actions/cache#92
https://github.com/actions/cache/tree/main/save#always-save-cache