Skip to content

ci: add revive lint and goreleaser dry-run jobs#7

Merged
lbfsc merged 3 commits into
mainfrom
chore/ci-add-revive-and-goreleaser-check
May 14, 2026
Merged

ci: add revive lint and goreleaser dry-run jobs#7
lbfsc merged 3 commits into
mainfrom
chore/ci-add-revive-and-goreleaser-check

Conversation

@zpzjzj
Copy link
Copy Markdown
Collaborator

@zpzjzj zpzjzj commented May 14, 2026

Summary

Two gaps the existing CI didn't cover:

  • revive not in CI. The Makefile and .githooks/pre-commit both run it (alongside golangci-lint), but ci.yml only runs golangci-lint. A change that fails revive could pass CI yet fail the next pre-commit, and vice-versa.
  • No goreleaser validation before tagging. .goreleaser.yaml was only exercised when a v* tag was pushed. Config or build regressions stayed invisible until release time, when they are most expensive to fix.

This PR extends .github/workflows/ci.yml only — no production code changes:

  • The Lint job now installs revive@v1.10.0 (same version as Makefile) and runs revive -config revive.toml ./....
  • A new release-dryrun job runs goreleaser check plus goreleaser release --snapshot --clean --skip=publish on every push / PR, so config or cross-compile regressions surface before tagging.

Both run on ubuntu-latest with Go 1.25.x, matching the existing jobs.

Test plan

  • revive -config revive.toml ./... passes locally (0 issues).
  • Pre-commit hook (which runs the same revive command) passes for the commit on this branch.
  • CI: Lint job now has revive step appearing after golangci-lint.
  • CI: new GoReleaser Check job runs goreleaser check and goreleaser release --snapshot --clean --skip=publish.

🤖 Generated with Claude Code

Two gaps the existing CI didn't cover:

1. `revive` was wired into the Makefile and the pre-commit hook in
   `.githooks/`, but CI only ran `golangci-lint`. A change that fails
   revive could pass CI yet fail the next pre-commit, or vice versa.

2. `.goreleaser.yaml` was only exercised at tag push. A broken config
   was invisible until release time, when it is most expensive to fix.

This change extends `.github/workflows/ci.yml`:

- The Lint job now installs `revive@v1.10.0` (same version as the
  Makefile) and runs `revive -config revive.toml ./...`.
- A new `release-dryrun` job runs `goreleaser check` plus
  `goreleaser release --snapshot --clean --skip=publish` on every
  push / PR so config or build regressions surface before tagging.

Both run on ubuntu-latest with go 1.25.x, matching the existing jobs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zpzjzj zpzjzj force-pushed the chore/ci-add-revive-and-goreleaser-check branch from 74e40d4 to 0fccc1a Compare May 14, 2026 07:12
GoReleaser v2 flags several archives.* and snapshot.* fields as
deprecated:

- archives.builds → archives.ids
- archives.format / format_overrides.format → formats (plural)
- snapshot.name_template → snapshot.version_template

Migrations are mechanical; functional output is identical. All caught
by the new `GoReleaser Check` CI job introduced earlier on this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zpzjzj zpzjzj force-pushed the chore/ci-add-revive-and-goreleaser-check branch from 0fccc1a to 7a06c1c Compare May 14, 2026 07:13
@zpzjzj zpzjzj requested a review from lbfsc May 14, 2026 07:30
Mirror the path filter that `docs.yml` already uses, but inverted:
docs / top-level markdown / the docs workflow itself should not trigger
a full Go build + test + lint + goreleaser cycle.

Caveat: if these jobs are ever promoted to required status checks,
GitHub will mark them as "Expected — Waiting" on docs-only PRs and
block merges. The standard fix in that case is a no-op meta-job that
always reports success; out of scope here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@lbfsc lbfsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lbfsc lbfsc merged commit 30a1f6f into main May 14, 2026
6 checks passed
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.

2 participants