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:
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:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
Repro steps:
Run setup-go with cache in master
create feature branch and run the job that involve actions/cache
cache key cannot be found
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:
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 @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.
![image](https://private-user-images.githubusercontent.com/11158339/331759821-311e181c-3e9d-42b5-9caa-b1b9257cff12.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzQ0NTMsIm5iZiI6MTcyMTEzNDE1MywicGF0aCI6Ii8xMTE1ODMzOS8zMzE3NTk4MjEtMzExZTE4MWMtM2U5ZC00MmI1LTljYWEtYjFiOTI1N2NmZjEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEyNDkxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3YjE0YzcyNzQ2YWQ5ZTY5OGZiNzg3ZjU1NzVhYmZhOGQ1NzA2OWQyODIzMWIxNGJhNWI2ZjI3MDMyNTliM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.U-t9tvEyO0o9-Y2cZmxZdVlOj3vVDW29DhD1oNiJMSA)
but when I run the feature branch action, it said it cannot find the cache with key created by actions/setup-go in master
![image](https://private-user-images.githubusercontent.com/11158339/331759901-9fe77667-8a93-4e62-be60-fc4f61843429.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzQ0NTMsIm5iZiI6MTcyMTEzNDE1MywicGF0aCI6Ii8xMTE1ODMzOS8zMzE3NTk5MDEtOWZlNzc2NjctOGE5My00ZTYyLWJlNjAtZmM0ZjYxODQzNDI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEyNDkxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzMWZjY2UxNThjN2Y3MzNjNGU3ZWJmMWQyNGUzMzVlNjJmNjU4NmMxNDdiMjUzOWZlMmFjMDljMjkxNjUzYzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3DRYp5yK7aUoF76MGiaKqaRGHhEr-riBgiA48_xLkOQ)
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: