fix(ci): pin GOMODCACHE for goreleaser-cross module cache mount - #701
Merged
Merged
Conversation
The goreleaser-cross image resolves GOPATH=$HOME/go, so its module cache is /root/go/pkg/mod, not /go/pkg/mod. Bind-mounting the host module cache at /go/pkg/mod without also setting GOMODCACHE was therefore ignored: the container re-downloaded every module fresh and the staged (gitignored) canvasassets embed inputs were absent, failing the snapshot build with 'pattern appsassets: no matching files found'. Pass -e GOMODCACHE=/go/pkg/mod in both the go.yml snapshot run and the release.yml release run, and upload ci-logs/ as an artifact when the snapshot job fails so goreleaser/mcpb failures keep their raw logs.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Coverage ReportTotal Coverage: 55.3% Generated from commit: ebd6921 |
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.
Pins
GOMODCACHE=/go/pkg/modin the goreleaser-cross container invocations so the bind-mounted host module cache (with the staged canvasassets embed inputs) is the one Go resolves. The image defaults to GOPATH=$HOME/go, so the mount to /go/pkg/mod was ignored and every container build re-downloaded modules fresh, failing withpattern appsassets: no matching files found.Also adds a
ci-logsartifact upload (if: always()) to the snapshot job so goreleaser/mcpb failures keep their tee'd logs.Description
Fixes the goreleaser-cross CI runs so the staged
canvasassetsembed inputs are actually used during cross-compilation.Problem:
The
ghcr.io/goreleaser/goreleaser-crossDocker image usesGOPATH=$HOME/goby default, which makes itsGOMODCACHEresolve to/root/go/pkg/mod— not the/go/pkg/modpath where the host module cache is bind-mounted. As a result the mount was silently ignored, the container re‑downloaded every module fresh, and the//go:embed appsassetsinputs (staged on the host) were absent, failing the build withpattern appsassets: no matching files found.Changes made:
.github/workflows/go.ymland.github/workflows/release.yml, explicitly set the environment variableGOMODCACHE=/go/pkg/modin thedocker runcommand. This aligns the container’s module cache target with the mounted host cache, so the pre‑staged embedded assets are visible to the cross‑build..github/workflows/go.yml, added an “Upload ci logs” step (usingif: always()) that uploads theci-logs/directory even on failure, retaining artifacts for 7 days. This ensures diagnostic logs from goreleaser or .mcpb runs are preserved even when the build fails.