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
ci: use the same go mod cache across test-core jobs #15006
Conversation
@@ -58,22 +72,23 @@ jobs: | |||
- uses: magnetikonline/action-golang-cache@v1 | |||
with: | |||
go-version: ${{env.GO_VERSION}} | |||
cache-key-suffix: -compile | |||
cache-key-suffix: -core | |||
- name: Run make dev | |||
env: | |||
GOBIN: ${{env.GOROOT}}/bin # windows kludge | |||
run: | | |||
make bootstrap |
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.
If we're caching the results of make bootstrap
in mods
, do we need this anymore?
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.
We do because GOBIN isn't part of the cache - the executables aren't cached across runners, only the GOMODCACHE and GOCACHE contents. magnetikonline/action-golang-cache#1 mentions the possibility of adding GOBIN but hasn't gotten traction. The resolution of actions/setup-go#278 might also impact what happens to the binaries.
@@ -40,13 +53,14 @@ jobs: | |||
- uses: magnetikonline/action-golang-cache@v1 | |||
with: | |||
go-version: ${{env.GO_VERSION}} |
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.
Not part of this work, so feel free to ignore it, but we could read the Go version from the .go-version
file like the release workflow.
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.
yeah we should be able to set go-version-file: go.mod
instead; i'm gonna try that in a follow up pr
* ci: use the same go mod cache for test-core jobs * ci: precache go modules * ci: add a mods precache job
* ci: use the same go mod cache across test-core jobs (#15006) * ci: use the same go mod cache for test-core jobs * ci: precache go modules * ci: add a mods precache job * ci: add -core suffix to mods action (#15015) Forgot to add this line to the new mods action; without it, it creates a cache different from the one used by the other jobs. * ci: use groups of tests in gha (#15018) * [no ci] use json for grouping packages for testing * [no ci] able to get packages in group * [no ci] able to run groups of tests * [no ci] more * [no ci] try disable circle unit tests * ci: use actions/checkout@v3 * ci: rename to quick * ci: need make dev in mods cache step * ci: make compile step depend on checks step * ci: bump consul and vault versions * ci: need make dev for group tests * ci: update ci unit testing docs * docs: spell plumbing correctly Co-authored-by: Tim Gross <tgross@hashicorp.com> Co-authored-by: Tim Gross <tgross@hashicorp.com> * deps: run go mod tidy Co-authored-by: Tim Gross <tgross@hashicorp.com>
* ci: use the same go mod cache across test-core jobs (#15006) * ci: use the same go mod cache for test-core jobs * ci: precache go modules * ci: add a mods precache job * ci: add -core suffix to mods action (#15015) Forgot to add this line to the new mods action; without it, it creates a cache different from the one used by the other jobs. * ci: use groups of tests in gha (#15018) * [no ci] use json for grouping packages for testing * [no ci] able to get packages in group * [no ci] able to run groups of tests * [no ci] more * [no ci] try disable circle unit tests * ci: use actions/checkout@v3 * ci: rename to quick * ci: need make dev in mods cache step * ci: make compile step depend on checks step * ci: bump consul and vault versions * ci: need make dev for group tests * ci: update ci unit testing docs * docs: spell plumbing correctly Co-authored-by: Tim Gross <tgross@hashicorp.com> Co-authored-by: Tim Gross <tgross@hashicorp.com> * deps: run go mod tidy Co-authored-by: Tim Gross <tgross@hashicorp.com>
* ci: backport of gha groups (#15058) * ci: use the same go mod cache across test-core jobs (#15006) * ci: use the same go mod cache for test-core jobs * ci: precache go modules * ci: add a mods precache job * ci: add -core suffix to mods action (#15015) Forgot to add this line to the new mods action; without it, it creates a cache different from the one used by the other jobs. * ci: use groups of tests in gha (#15018) * [no ci] use json for grouping packages for testing * [no ci] able to get packages in group * [no ci] able to run groups of tests * [no ci] more * [no ci] try disable circle unit tests * ci: use actions/checkout@v3 * ci: rename to quick * ci: need make dev in mods cache step * ci: make compile step depend on checks step * ci: bump consul and vault versions * ci: need make dev for group tests * ci: update ci unit testing docs * docs: spell plumbing correctly Co-authored-by: Tim Gross <tgross@hashicorp.com> Co-authored-by: Tim Gross <tgross@hashicorp.com> * deps: run go mod tidy Co-authored-by: Tim Gross <tgross@hashicorp.com> * build: fix makefile conflict Co-authored-by: Tim Gross <tgross@hashicorp.com>
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR configures the
test-core
Action(?) with a newmods
job on which theother jobs depend on. The mods job just runs
mod tidy
andbootstrap
to downloadall the Go modules that will be needed and caches them. The dependent jobs then make
use of the same cache so they do not need to download / cache the near 1GB of modules
themselves.
Closes #15000