Optimize CI tooling with tools.go pattern #50
Closed
+1,226
−31
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.
Summary
Implements the idiomatic Go
tools.gopattern to improve CI performance and developer experience.Performance Impact
Before: ~4 minutes for lint CI job
After: ~90 seconds for lint CI job
Improvement: 62% faster
Why This Is Fast
The key optimization: setup-go@v6's build cache stores compiled object files (
.aarchives) in~/.cache/go-build. When we rungo installfor the same tool versions:~/go/pkg/mod)~/.cache/go-build) ← HUGE SAVINGSResult: Tool installation goes from ~60s (cold compile) to ~10s (warm cache reuse).
Previously, the CI workflow hardcoded versions in YAML and installed tools fresh each run without leveraging setup-go@v6's caching. Now we use
tools.goto track dependencies ingo.mod, and setup-go@v6 automatically caches the expensive compilation step.Key Benefits
go.mod, not hardcoded in YAML./bin/(no conflicts)make install-toolslocally or in CIChanges
GOBIN=$(CURDIR)/binandinstall-toolstarget, updated lint targetsmake install-tools(removed hardcoded versions)/bin/directoryTool Version Updates
Testing
All linters pass cleanly with the updated versions.
Pattern Reference
This follows the standard Go tooling pattern documented in the community research and used by major projects.