Split PR CI into pre-commit, test, and build workflows #2
Reference in New Issue
Block a user
Delete Branch "benvin/ci-split"
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?
Why
Branch protection on this repo needs three independent PR status checks, but
Woodpecker exposes one
ci/woodpecker/pr/<file>context per workflow FILE. Thesingle
build.yaml(test + build-check in one workflow) only ever reports onecontext. Split it so each check surfaces separately.
Changes
.woodpecker/build.yamlinto three PR workflows:.woodpecker/pre-commit.yamlrunsmake pre-commit(pre-commit hooks)..woodpecker/test.yamlrunsmake test(go test -race ./...)..woodpecker/build.yamlkeeps only the container dry-run build-check..pre-commit-config.yaml(gofmt / go vet / go unit tests + trailingwhitespace / end-of-file / check-yaml / merge-conflict / line-ending hooks).
pre-commitMakefile target (testalready existed)..woodpecker/docker.yaml(tagv*release) is unchanged.Each PR workflow uses
when: event: [pull_request, push],serviceAccountName: default, and k8s resource requests/limits.Verification
make pre-commitclean (all hooks Passed).make testgreen.check-yaml) pass on all workflow files.Once this repo is activated in Woodpecker the three checks
(
ci/woodpecker/pr/pre-commit,ci/woodpecker/pr/test,ci/woodpecker/pr/build) will report on each PR. terraform-git #79 is beingupdated in tandem to require all three.