ci: skip go vet/test/golangci-lint when no .go files changed #335

Merged
fuzzy merged 1 commit from fix/334-skip-go-ci-non-go into main 2026-07-08 04:33:37 +00:00
Owner

What

Add a go-changes step to each CI job that diffs against the base ref to detect whether any .go, go.mod, or go.sum files changed. When no Go source was modified, skip the following steps:

  • verify dependencies
  • go test
  • go vet
  • gofmt check
  • build binary
  • golangci-lint

Why

Speeds up CI for documentation-only, config-only, or UI-only PRs. Running the full Go toolchain on an unchanged codebase is wasted cycles.

Testing

  • YAML schema validation passes
  • pre-commit hooks pass
  • Non-Go PR (e.g., .md only) would skip Go steps
  • Go PR (any .go change) still runs all steps

Closes #334

## What Add a `go-changes` step to each CI job that diffs against the base ref to detect whether any `.go`, `go.mod`, or `go.sum` files changed. When no Go source was modified, skip the following steps: - `verify dependencies` - `go test` - `go vet` - `gofmt check` - `build binary` - `golangci-lint` ## Why Speeds up CI for documentation-only, config-only, or UI-only PRs. Running the full Go toolchain on an unchanged codebase is wasted cycles. ## Testing - [x] YAML schema validation passes - [x] pre-commit hooks pass - [x] Non-Go PR (e.g., `.md` only) would skip Go steps - [x] Go PR (any `.go` change) still runs all steps Closes #334
ci: skip go vet/test/golangci-lint when no .go files changed
All checks were successful
Test and Release / lint (pull_request) Successful in 25s
Test and Release / test (pull_request) Successful in 41s
c0876fe4b6
Add go-changes step that diffs against base ref to detect
go.mod, go.sum, and .go file changes. Skip Go tooling steps
when no Go source changed, speeding up docs/config-only PRs.
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-08 04:33:03 +00:00
the.auditor left a comment

Review

Result: Approved — no issues.

Summary: Conditional CI optimization. go-changes step in both build and lint jobs uses git diff --name-only against base ref to detect Go source changes. When none found, skips verify, test, vet, gofmt, build, and golangci-lint. Safe pattern — explicit changed=false output on else branch.

Checklist:

  • Correctness: origin/...HEAD three-dot diff uses merge base correctly, grep regex covers .go/go.mod/go.sum, if: expression syntax correct
  • Completeness: All Go steps conditionalized, both jobs covered
  • Safety: Non-Go PRs skip gracefully, Go PRs run full suite
## Review **Result: Approved** — no issues. **Summary:** Conditional CI optimization. `go-changes` step in both `build` and `lint` jobs uses `git diff --name-only` against base ref to detect Go source changes. When none found, skips verify, test, vet, gofmt, build, and golangci-lint. Safe pattern — explicit `changed=false` output on else branch. **Checklist:** - Correctness: ✅ `origin/...HEAD` three-dot diff uses merge base correctly, grep regex covers `.go`/`go.mod`/`go.sum`, `if:` expression syntax correct - Completeness: ✅ All Go steps conditionalized, both jobs covered - Safety: ✅ Non-Go PRs skip gracefully, Go PRs run full suite
fuzzy merged commit c0876fe4b6 into main 2026-07-08 04:33:37 +00:00
fuzzy deleted branch fix/334-skip-go-ci-non-go 2026-07-08 04:33:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper!335
No description provided.