fix(ci): set GOARCH on scanner cache step for correct cache keys#19578
Closed
fix(ci): set GOARCH on scanner cache step for correct cache keys#19578
Conversation
pre-build-scanner-go-binary cross-compiles for multiple architectures (amd64, arm64, ppc64le, s390x) but the cache-go-dependencies step reads GOARCH via `go env GOARCH` which returns the runner's native arch (amd64) when GOARCH is not set in the environment. All arch variants share one cache key, restoring incompatible entries. Fix: set GOARCH to matrix.goarch on the cache step, matching what build.yaml already does for pre-build-go-binaries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
Contributor
|
Images are ready for the commit at f29c12f. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19578 +/- ##
=======================================
Coverage 49.26% 49.26%
=======================================
Files 2735 2735
Lines 206138 206138
=======================================
Hits 101546 101546
Misses 97045 97045
Partials 7547 7547
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:
|
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.
Summary
Set
GOARCHenvironment variable on thecache-go-dependenciesstep inpre-build-scanner-go-binaryso each architecture gets its own GOCACHE key.Problem
The scanner build matrix cross-compiles for multiple architectures (amd64, arm64, ppc64le, s390x). The cache action reads
go env GOARCHto include the architecture in the cache key, but withoutGOARCHset in the environment, it always returns the runner's nativeamd64. All architecture variants share one cache entry containing incompatible.afiles.Fix
Add
env: GOARCH: ${{ matrix.goarch }}to the cache step, matching howbuild.yamlalready handles this forpre-build-go-binaries.Partially generated by AI.