ci: run build, vet and tests on push and pull requests - #1
Merged
Conversation
release.yml was the only workflow and it fires solely on v* tags, so nothing verified a commit until a release was already being cut -- and a bad .goreleaser.yaml surfaced as a failed release job after the tag already existed. Adds a ci workflow running on pushes to main, on pull requests, and via workflow_dispatch: - test: gofmt gate, `go mod tidy` drift gate, build, vet, and `go test -race ./...` (the View layer is TTY-free, so the suite runs headless; -race covers the async polling commands). - goreleaser-config: `goreleaser check`, so config errors fail on a pull request instead of on a tag. Both jobs resolve Go from go-version-file so CI tracks the pinned toolchain rather than drifting with "stable". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Found by the goreleaser-config job added in this branch. `goreleaser
check` rejects the config outright, so the release job would have failed
after a tag was already pushed.
- nfpms.files -> nfpms.contents. `files` is a v1 name and is not part of
the v2 schema; this was the hard failure.
- archives.format -> archives.formats. Singular is deprecated in v2 and
becomes an error once the deprecation window closes.
- Drop -extldflags "{{.Env.LDFLAGS}}". It required an LDFLAGS env var to
be set at release time and is a no-op under CGO_ENABLED=0, since no
external linker is involved.
- Translate the one non-English comment.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
goreleaser check treats deprecated properties as a failure (exit 2), so this kept the config job red even though the schema was otherwise valid. version_template is the v2 name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
release.ymlwas the only workflow, and it fires solely onv*tags — so nothing verified a commit until a release was already being cut. A broken.goreleaser.yamlwould only surface as a failed release job after the tag existed.What
A
ciworkflow on pushes tomain, on pull requests, and viaworkflow_dispatch(for a pre-tag sanity check). Concurrency cancels superseded runs; permissions are read-only.testjobgofmt -lgatego mod tidydrift gate — fails ifgo.mod/go.sumwould changego build ./...,go vet ./...go test -race ./...— the View layer is TTY-free so the suite runs headless, and-racecovers the asynctea.Cmdstatus/ping pollinggoreleaser-configjobgoreleaser check, so config errors fail on a PR instead of on a tagBoth jobs resolve Go via
go-version-file: go.mod, so CI tracks the pinned toolchain instead of drifting withstable.Notes
Landing this first so subsequent PRs are gated by it. Deliberately scoped to the workflow file only — the README badge and the phase-log entry ride along with the release PR to avoid doc conflicts.
Verified locally: every step above passes, including
-race.