-
Notifications
You must be signed in to change notification settings - Fork 437
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
[1.14] Use Native Cache Action (instead of setup-go) #8538
[1.14] Use Native Cache Action (instead of setup-go) #8538
Conversation
Issues linked to changelog: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - do we need to put some of these changes on main as well?
Yeah my plan is to prove out these changes on a branch (1.14 has most recent CI changes, but isn't developed against as often so if I break something it won't be as impactful). After I can prove out on a branch, I will make this consistent across our other LTS branches (including main) |
* try to create re-usable prep-go-runner lik other branches * fix yaml * fix yaml * introduce cache delete * use env.goversion * use previous step * change step name * use env variables, dont hardcoded * formatting change * dont use set-output * add go mod action in cache-setup * runs -> run * no-op to trigger ci * simplfiy codegen to use prep-go-runner * tidy after download * add mod-tidy * remove cache cleanup, add in other pr * use prep-go-runner more broadly * remove testing branch * tidy after codegen * use explicit list * use list again * include github workspace in cache path * only cache mod-download * set path on cache save * fix cache logic * fix pathing * cache go tools and test tools * use on pull request to see if cache is shared * no-op to trigger ci * emit cache contents * list sizes * max depth 1 * emit cache size after tests and codegen * only use modcache * fix prep go runner * add changelog
* [1.14] Introduce GHA Go Cache on LTS (#8535) * have codegen run on merge * add changelog * cache go modules job, dont reuse codegen * undo codegen job changes * filter only lts branches * [1.14] Use Native Cache Action (instead of setup-go) (#8538) * try to create re-usable prep-go-runner lik other branches * fix yaml * fix yaml * introduce cache delete * use env.goversion * use previous step * change step name * use env variables, dont hardcoded * formatting change * dont use set-output * add go mod action in cache-setup * runs -> run * no-op to trigger ci * simplfiy codegen to use prep-go-runner * tidy after download * add mod-tidy * remove cache cleanup, add in other pr * use prep-go-runner more broadly * remove testing branch * tidy after codegen * use explicit list * use list again * include github workspace in cache path * only cache mod-download * set path on cache save * fix cache logic * fix pathing * cache go tools and test tools * use on pull request to see if cache is shared * no-op to trigger ci * emit cache contents * list sizes * max depth 1 * emit cache size after tests and codegen * only use modcache * fix prep go runner * add changelog * Validate GHA Cache Hit (#8545) * Add no-op commit * fix cache hit logic, remove do-not-submit * add changelog * consolidate changelogs
* [1.14] Introduce GHA Go Cache on LTS (#8535) * have codegen run on merge * add changelog * cache go modules job, dont reuse codegen * undo codegen job changes * filter only lts branches * [1.14] Use Native Cache Action (instead of setup-go) (#8538) * try to create re-usable prep-go-runner lik other branches * fix yaml * fix yaml * introduce cache delete * use env.goversion * use previous step * change step name * use env variables, dont hardcoded * formatting change * dont use set-output * add go mod action in cache-setup * runs -> run * no-op to trigger ci * simplfiy codegen to use prep-go-runner * tidy after download * add mod-tidy * remove cache cleanup, add in other pr * use prep-go-runner more broadly * remove testing branch * tidy after codegen * use explicit list * use list again * include github workspace in cache path * only cache mod-download * set path on cache save * fix cache logic * fix pathing * cache go tools and test tools * use on pull request to see if cache is shared * no-op to trigger ci * emit cache contents * list sizes * max depth 1 * emit cache size after tests and codegen * only use modcache * fix prep go runner * add changelog * Validate GHA Cache Hit (#8545) * Add no-op commit * fix cache hit logic, remove do-not-submit * add changelog * consolidate changelogs
* [1.13] Introduce GHA Cache on LTS (#8550) * [1.14] Introduce GHA Go Cache on LTS (#8535) * have codegen run on merge * add changelog * cache go modules job, dont reuse codegen * undo codegen job changes * filter only lts branches * [1.14] Use Native Cache Action (instead of setup-go) (#8538) * try to create re-usable prep-go-runner lik other branches * fix yaml * fix yaml * introduce cache delete * use env.goversion * use previous step * change step name * use env variables, dont hardcoded * formatting change * dont use set-output * add go mod action in cache-setup * runs -> run * no-op to trigger ci * simplfiy codegen to use prep-go-runner * tidy after download * add mod-tidy * remove cache cleanup, add in other pr * use prep-go-runner more broadly * remove testing branch * tidy after codegen * use explicit list * use list again * include github workspace in cache path * only cache mod-download * set path on cache save * fix cache logic * fix pathing * cache go tools and test tools * use on pull request to see if cache is shared * no-op to trigger ci * emit cache contents * list sizes * max depth 1 * emit cache size after tests and codegen * only use modcache * fix prep go runner * add changelog * Validate GHA Cache Hit (#8545) * Add no-op commit * fix cache hit logic, remove do-not-submit * add changelog * consolidate changelogs * move changelog * fix bad merge * fix changelog * remove duplicate mod-tidy
* [1.13] Introduce GHA Cache on LTS (#8550) * [1.14] Introduce GHA Go Cache on LTS (#8535) * have codegen run on merge * add changelog * cache go modules job, dont reuse codegen * undo codegen job changes * filter only lts branches * [1.14] Use Native Cache Action (instead of setup-go) (#8538) * try to create re-usable prep-go-runner lik other branches * fix yaml * fix yaml * introduce cache delete * use env.goversion * use previous step * change step name * use env variables, dont hardcoded * formatting change * dont use set-output * add go mod action in cache-setup * runs -> run * no-op to trigger ci * simplfiy codegen to use prep-go-runner * tidy after download * add mod-tidy * remove cache cleanup, add in other pr * use prep-go-runner more broadly * remove testing branch * tidy after codegen * use explicit list * use list again * include github workspace in cache path * only cache mod-download * set path on cache save * fix cache logic * fix pathing * cache go tools and test tools * use on pull request to see if cache is shared * no-op to trigger ci * emit cache contents * list sizes * max depth 1 * emit cache size after tests and codegen * only use modcache * fix prep go runner * add changelog * Validate GHA Cache Hit (#8545) * Add no-op commit * fix cache hit logic, remove do-not-submit * add changelog * consolidate changelogs * move changelog * fix bad merge * fix changelog * remove duplicate mod-tidy
Description
Continuation of work from #8535
CI changes
Context
I noticed inconsistent cache behaviors: https://github.com/solo-io/solo-projects/issues/4903#issuecomment-1664341061
The hash used in the cache key was identical for a PR that was merged into 1.14 as a cache entry for the main (1.15) branch. This shouldn't be the case because the go.sums are very different
The build cache (understandably) grows between the time we:
188M /home/runner/.cache/go-build
, https://github.com/solo-io/gloo/actions/runs/5765012033/job/15630127216?pr=8538)2.1G /home/runner/.cache/go-build
, https://github.com/solo-io/gloo/actions/runs/5765012033/job/15630127216?pr=8538)3.3G /home/runner/.cache/go-build
, https://github.com/solo-io/gloo/actions/runs/5765012028/job/15630131257)It's not clear to me what elements from that cache are useful for other jobs, and under what circumstances that cache should be invalidated (ie what do we use to build a cache key). As a result, I don't feel comfortable including it in our CI. I would rather understand exactly what is cached, and if we decide we need more caching, add it.
It should be noted this mirrors GME
Interesting decisions
I opted to just rely on the base cache action since it provides more functionality. To avoid drift in how we use it, I wrapped this setup in a shared github action.
Testing steps
Again, I can prove that the cache is built, but there isn't a perfect way to prove out the cache will be re-used for future PRs against this branch.
Notes for reviewers
None
Checklist: