Skip to content

ci: run build, vet and tests on push and pull requests - #1

Merged
Phundahl merged 3 commits into
mainfrom
ci/add-test-workflow
Aug 20, 2026
Merged

ci: run build, vet and tests on push and pull requests#1
Phundahl merged 3 commits into
mainfrom
ci/add-test-workflow

Conversation

@Phundahl

Copy link
Copy Markdown
Owner

Why

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. A broken .goreleaser.yaml would only surface as a failed release job after the tag existed.

What

A ci workflow on pushes to main, on pull requests, and via workflow_dispatch (for a pre-tag sanity check). Concurrency cancels superseded runs; permissions are read-only.

test job

  • gofmt -l gate
  • go mod tidy drift gate — fails if go.mod/go.sum would change
  • go build ./..., go vet ./...
  • go test -race ./... — the View layer is TTY-free so the suite runs headless, and -race covers the async tea.Cmd status/ping polling

goreleaser-config job

  • goreleaser check, so config errors fail on a PR instead of on a tag

Both jobs resolve Go via go-version-file: go.mod, so CI tracks the pinned toolchain instead of drifting with stable.

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.

Phundahl and others added 3 commits August 20, 2026 13:37
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>
@Phundahl
Phundahl merged commit b59a87e into main Aug 20, 2026
2 checks passed
@Phundahl
Phundahl deleted the ci/add-test-workflow branch August 20, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant