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

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.
This commit is contained in:
unkin-agent
2026-08-22 15:16:04 +10:00
parent 3c9f9d6de4
commit eb3a18ff1c
5 changed files with 60 additions and 16 deletions
+7 -1
View File
@@ -6,7 +6,7 @@ GOFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH)
.PHONY: all build test test-integration lint fmt clean docker patch minor major _tag
.PHONY: all build test test-integration lint fmt pre-commit clean docker patch minor major _tag
all: build
@@ -27,6 +27,12 @@ lint:
fmt:
gofmt -w .
# Run the pre-commit hooks across the whole tree. uvx fetches pre-commit on
# demand; falls back to a bare pre-commit on PATH if uvx is absent.
pre-commit:
@if command -v uvx >/dev/null 2>&1; then uvx pre-commit run --all-files; \
else pre-commit run --all-files; fi
clean:
rm -rf $(DIST)