Skip to content

ci: run gofmt, vet, build, and tests on pull requests - #43

Merged
giraffesyo merged 1 commit into
canaryfrom
chore/gofmt-ir
Aug 4, 2026
Merged

ci: run gofmt, vet, build, and tests on pull requests#43
giraffesyo merged 1 commit into
canaryfrom
chore/gofmt-ir

Conversation

@giraffesyo

Copy link
Copy Markdown
Member

Why

The repo had no CI. .github/workflows/ held only release-please.yml, which triggers on push to canary — nothing ran go build, go test, gofmt, or go vet against a branch before it merged. That's how internal/ir/auth.go and internal/ir/operations.go reached canary unformatted.

What this adds

.github/workflows/ci.yml, on pull_request and on push to canary:

Step Command
gofmt gofmt -l ., failing with a diff if anything is unformatted
build go build ./...
vet go vet ./...
test go test ./...
  • Go version comes from go.mod (go-version-file), so the toolchain tracks the module instead of drifting from a pinned string.
  • Module cache enabled; concurrency cancels superseded runs on force-push.
  • permissions: contents: read — the job needs nothing else.

The test step is the load-bearing one: internal/generator's e2e tests generate clients from the testdata specs and then compile and run them, so a broken template fails in CI rather than in a consumer's build. The generated packages have no external dependencies, so those nested go test runs need no network.

Also in this PR

gofmt -w on the two offending files — pure comment realignment in AuthScheme and OperationDef, no semantic change. Without it the new gofmt step fails on arrival.

Still needed (org-level, not something a PR can set)

The parallelworks org ruleset applied to this repo's default branch requires 2 approvals, linear history, and squash merges — but has no required_status_checks rule. So even once this workflow exists, a red run won't block a merge. Adding ci / build as a required check on ~DEFAULT_BRANCH would close that gap.

The only workflow was release-please on push to canary, so nothing verified a
branch before it merged and unformatted files reached canary unnoticed.

Also reformats internal/ir/auth.go and internal/ir/operations.go, which the
new gofmt step flags.
@giraffesyo
giraffesyo merged commit 219216d into canary Aug 4, 2026
1 check passed
@giraffesyo
giraffesyo deleted the chore/gofmt-ir branch August 4, 2026 23:25
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