ci: skip go vet/test/golangci-lint when no .go files changed #335
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!335
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/334-skip-go-ci-non-go"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add a
go-changesstep to each CI job that diffs against the base ref to detect whether any.go,go.mod, orgo.sumfiles changed. When no Go source was modified, skip the following steps:verify dependenciesgo testgo vetgofmt checkbuild binarygolangci-lintWhy
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
.mdonly) would skip Go steps.gochange) still runs all stepsCloses #334
Review
Result: Approved — no issues.
Summary: Conditional CI optimization.
go-changesstep in bothbuildandlintjobs usesgit diff --name-onlyagainst base ref to detect Go source changes. When none found, skips verify, test, vet, gofmt, build, and golangci-lint. Safe pattern — explicitchanged=falseoutput on else branch.Checklist:
origin/...HEADthree-dot diff uses merge base correctly, grep regex covers.go/go.mod/go.sum,if:expression syntax correct