fix: create reusable setup-go action to fix Go module cache in CI workflows#8257
fix: create reusable setup-go action to fix Go module cache in CI workflows#8257yurishkuro merged 5 commits intomainfrom
Conversation
Agent-Logs-Url: https://github.com/jaegertracing/jaeger/sessions/e3e94f8b-2613-4071-9c22-52a1dd0d77c9 Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com>
…flows Agent-Logs-Url: https://github.com/jaegertracing/jaeger/sessions/c741cabb-deef-4d64-bd0d-63638ebba2ad Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com>
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves CI reliability and performance by standardizing Go toolchain setup and module caching across workflows, preventing inconsistent cache keys caused by repo-wide **/go.sum scanning.
Changes:
- Added a reusable composite action
.github/actions/setup-gothat wrapsactions/setup-goand pinscache-dependency-pathto./go.sumand./internal/tools/go.sum. - Updated CI workflows to use the new local
./.github/actions/setup-goaction instead of callingactions/setup-godirectly. - Removed per-workflow
cache-dependency-pathduplication where it existed.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/fossa.yml | Switches Go setup to the reusable local setup-go action. |
| .github/workflows/codeql.yml | Uses reusable setup-go for Go language runs to stabilize caching. |
| .github/workflows/ci-unit-tests.yml | Replaces direct setup-go + per-workflow cache path with the reusable action. |
| .github/workflows/ci-summary-report.yml | Uses reusable setup-go for coverage tooling setup with consistent cache keying. |
| .github/workflows/ci-release.yml | Uses reusable setup-go in release workflow to standardize caching. |
| .github/workflows/ci-lint-checks.yaml | Replaces direct setup-go in multiple jobs with reusable setup-go. |
| .github/workflows/ci-e2e-tailsampling.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-spm.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-query.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-opensearch.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-memory.yaml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-kafka.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-grpc.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-elasticsearch.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-clickhouse.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-cassandra.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-e2e-badger.yaml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-docker-hotrod.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-docker-build.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-docker-all-in-one.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/workflows/ci-build-binaries.yml | Switches to reusable setup-go for consistent Go caching. |
| .github/actions/setup-go/action.yml | New composite action encapsulating Go setup with stable cache dependency paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8257 +/- ##
==========================================
+ Coverage 95.65% 95.67% +0.02%
==========================================
Files 318 318
Lines 16804 16804
==========================================
+ Hits 16074 16078 +4
+ Misses 577 574 -3
+ Partials 153 152 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Most CI workflows were using
actions/setup-gowithoutcache-dependency-path, causing the action to scan for all**/go.sumfiles in the repo. This produces an inconsistent cache key, leading to frequent cache misses and modules being re-downloaded on every run.Changes
.github/actions/setup-go/action.ymlthat wrapsactions/setup-goand always passes both./go.sumand./internal/tools/go.sumascache-dependency-path:./.github/actions/setup-goinstead of callingactions/setup-godirectlyThe
check-go-version.shlint script continues to work correctly since workflow files retaingo-version: 1.26.xin theirwith:sections. Thesetup-go-tipaction is intentionally excluded — that workflow explicitly purges the module cache immediately after setup.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.