-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why can't I re-use cache created by actions/setup-go for actions/cache? #480
Comments
Hello @sswastioyono18, Thank you for creating this issue and we will get back to you once we have some feedback on this :) |
Hi @sswastioyono18, The actions/setup-go does not inherently create a cache that can be reused by other actions. The cache option in actions/setup-go is specifically for speeding up the setup process by reusing a previously installed version of Go, if available. The actions/cache action, which is a separate entity, is designed for caching dependencies and build outputs to enhance the speed of the workflow. These two actions serve different functions and are used independently. To cache Go dependencies or build outputs, actions/cache is typically employed directly in the workflow configuration. The cache created by actions/setup-go is not designed to be reused by actions/cache as it doesn't cache Go dependencies or build outputs. And It's possible to utilize the cache created by actions/cache in the main branch within a feature branch. I hope this helps clarify the roles of these two different actions and how they can be utilized in GitHub Actions workflows. |
Hi @gowridurgad thanks for the explanation. We decided to use the action cache since it fits our use case. This issue can be closed. |
Description:
Hi, we are using ARC self hosted runner.
Currently we are evaluating whether we should cache from actions/setup-go or actions/cache by using restore and save.
actions/setup-go seems very good after the first build but we wanted to use the fallback to default option set from actions/cache.
We prefer the cache to be created by setup-go because we noticed during
go test
command, we realized if we use cache from setup-go, unit test seems run very fast while if we use cache from actions/cache, somehow we have to wait 1.5 mins for the test to start.So our idea to combine setup-go and actions/cache was to have daily job using setup-go for populating the cache while for usual task, we use actions/cache to only restore the cache and fallback to whatever cache it has.
Now the problem we faced is that it seems like cache key created in master branch by setup-go cannot be reused by actions/cache in feature branch.
but when I run the feature branch action, it said it cannot find the cache with key created by actions/setup-go in master
it looks like both actions/cache and actions/setup-go have hidden identifier key even though it looks the same (?)
looking at the source code of setup-go, the underlying cache creation seems to use actions/cache.so this should work as expected.
Action version:
v5
Platform:
Runner type:
Tools version:
Repro steps:
Expected behavior:
cache key can be found
Actual behavior:
cache key cannot be found even with same cache key
The text was updated successfully, but these errors were encountered: