Use actions/setup-go with caching for go install#64
Merged
jeffwidman merged 1 commit intomainfrom Mar 9, 2026
Merged
Conversation
79d756e to
0e3f799
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the smoke.yml workflow to replace the manual Add Go bin to PATH shell step with the actions/setup-go action, enabling automatic Go PATH setup and cross-run caching of the Go build and module cache via cache: true. The approach matches the existing pattern already used in ci.yml.
Changes:
- Replaced
Add Go bin to PATH(manualecho "$(go env GOPATH)/bin" >> "$GITHUB_PATH") withactions/setup-go@v6.2.0 - Added
go-version-file: go.modto use the project's declared Go version, consistent withci.yml - Enabled
cache: trueto cache the Go build/module cache across runs
Replace the manual 'Add Go bin to PATH' step with actions/setup-go, which handles PATH setup automatically and caches the Go build/module cache across runs (cache is enabled by default since v4, so no need to specify cache: true). Uses go-version-file to match the project's go.mod.
0e3f799 to
fd24e97
Compare
This was referenced Mar 9, 2026
Merged
truggeri
approved these changes
Mar 9, 2026
| - name: Install Go | ||
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 | ||
| with: | ||
| go-version-file: go.mod |
There was a problem hiding this comment.
Oh cool, I didn't know you could do that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the manual
Add Go bin to PATHstep withactions/setup-go, which handles PATH setup automatically and caches the Go build/module cache across runs.Why
The
go installstep in the smoke workflow takes ~23s.actions/setup-gocaches the Go build and module cache by default (since v4,cache: trueis the default so it doesn't need to be specified), so subsequent runs where the CLI version hasn't changed should be near-instant.Also uses
go-version-file: go.modto match the project's Go version, consistent withci.yml.Changes
Add Go bin to PATHshell step withactions/setup-go@v6.2.0go-version-file: go.mod(caching is enabled by default)