Split PR CI into pre-commit, test, and build workflows #2

Merged
benvin merged 1 commits from benvin/ci-split into main 2026-08-22 16:14:52 +10:00
Member

Why

Branch protection on this repo needs three independent PR status checks, but
Woodpecker exposes one ci/woodpecker/pr/<file> context per workflow FILE. The
single build.yaml (test + build-check in one workflow) only ever reports one
context. Split it so each check surfaces separately.

Changes

  • Split .woodpecker/build.yaml into three PR workflows:
    • .woodpecker/pre-commit.yaml runs make pre-commit (pre-commit hooks).
    • .woodpecker/test.yaml runs make test (go test -race ./...).
    • .woodpecker/build.yaml keeps only the container dry-run build-check.
  • Add .pre-commit-config.yaml (gofmt / go vet / go unit tests + trailing
    whitespace / end-of-file / check-yaml / merge-conflict / line-ending hooks).
  • Add a pre-commit Makefile target (test already existed).
  • .woodpecker/docker.yaml (tag v* release) is unchanged.

Each PR workflow uses when: event: [pull_request, push],
serviceAccountName: default, and k8s resource requests/limits.

Verification

  • make pre-commit clean (all hooks Passed).
  • make test green.
  • yaml hooks (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 being
updated in tandem to require all three.

## Why Branch protection on this repo needs three independent PR status checks, but Woodpecker exposes one `ci/woodpecker/pr/<file>` context per workflow FILE. The single `build.yaml` (test + build-check in one workflow) only ever reports one context. Split it so each check surfaces separately. ## Changes - Split `.woodpecker/build.yaml` into three PR workflows: - `.woodpecker/pre-commit.yaml` runs `make pre-commit` (pre-commit hooks). - `.woodpecker/test.yaml` runs `make test` (`go test -race ./...`). - `.woodpecker/build.yaml` keeps only the container dry-run build-check. - Add `.pre-commit-config.yaml` (gofmt / go vet / go unit tests + trailing whitespace / end-of-file / check-yaml / merge-conflict / line-ending hooks). - Add a `pre-commit` Makefile target (`test` already existed). - `.woodpecker/docker.yaml` (tag `v*` release) is unchanged. Each PR workflow uses `when: event: [pull_request, push]`, `serviceAccountName: default`, and k8s resource requests/limits. ## Verification - `make pre-commit` clean (all hooks Passed). - `make test` green. - yaml hooks (`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 being updated in tandem to require all three.
unkin-agent added 1 commit 2026-08-22 15:16:19 +10:00
Each Woodpecker workflow file maps to one ci/woodpecker/pr/<file> status
context, so break the single build.yaml into three PR workflows to expose
three separate PR checks:

- .woodpecker/pre-commit.yaml runs the pre-commit hooks via make pre-commit.
- .woodpecker/test.yaml runs make test (go test ./...).
- .woodpecker/build.yaml keeps only the container dry-run build-check.

Add .pre-commit-config.yaml (gofmt/go vet/go unit tests + whitespace/yaml
hooks) and a make pre-commit target. docker.yaml (tag release) is unchanged.
benvin merged commit 8654dab582 into main 2026-08-22 16:14:52 +10:00
benvin deleted branch benvin/ci-split 2026-08-22 16:14:52 +10:00
Sign in to join this conversation.