act: actions/cache@v2 error: Cache Service Url not found, unable to restore cache
I am not sure how the cache is meant to work with nektos/act, but when working around bug #257, the cache will always throw a cache-hit=false
with the following errors:
☁ git clone 'https://github.com/actions/cache' # ref=v2
🐳 docker cp src=/home/grische/.cache/act/actions-cache@v2 dst=/actions/
❓ ::save-state name=CACHE_KEY::Linux-2b7ee04efeb2a8c4ea27558750b1c2dee27f1692a30af56727638c98655a2410
💬 ::debug::Resolved Keys:
💬 ::debug::["Linux-2b7ee04efeb2a8c4ea27558750b1c2dee27f1692a30af56727638c98655a2410"]
💬 ::debug::Checking zstd --version
💬 ::debug::*** zstd command line interface 64-bits v1.3.3, by Yann Collet ***
💬 ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
💬 ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache.
⚙ ::set-output:: cache-hit=false
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 50
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Fix GH Actions in act act is a tool that let's users test GitHub Actions on a local machine, but it doesn't support caching at the moment. https://github.com/nektos/act/issues/285#issuecomment-987550... — committed to Smart123s/FastLogin by Smart123s 2 years ago
- Fix GH Actions in act act is a tool that let's users test GitHub Actions on a local machine, but it doesn't support caching at the moment. https://github.com/nektos/act/issues/285#issuecomment-987550... — committed to Smart123s/FastLogin by Smart123s 2 years ago
If you are using nektos/act to develop GHA workflows locally and want to get
actions/cache
working so that you can get faster feedback when you test-run on your changes to GHA workflow yaml files;if: ${{ !env.ACT }}
--reuse
flag.I will repeat that last step, because it is a much better solution than trying to get the cache action working locally;
Use act’s
--reuse
flagFrom the docs;
-r, --reuse reuse action containers to maintain state
Cache saving and restoring becomes unnecessary.
Issue is stale and will be closed in 7 days unless there is new activity
Google search suggestions and results suggest that this is a popular topic and issue;
As @netaskd as informed us, this only works if each job has the same
jobs.{id}.name:
value, which, as you may expect, not ideal. It would be nice if--reuse
reused the container for the whole workflow.It seems
--reuse
keys onjobs.{id}.name
for reuse.@BevanR in this case we have to set
name:
field the same for each jobs, that usesactions/cache
. Otherwise it does not work…I guess this can be tracked as part of #329
Any progress on this? seems to be linked to #329