Switch Go CI steps to gobuilder + S3 build cache
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

Cuts go vet/go test wall time via a shared package-object cache.

- pre-commit and test steps move from docker.io/golang:1.26 to the
  pinned estate gobuilder image (go1.26.7, trusts the internal CA)
- wire GOCACHEPROG to go-cache-plugin against the S3 cache bucket,
  creds from org-level GOCACHE_AWS_* secrets
- bump test step memory limit to 4Gi for envtest + -race headroom
- buildx steps (build.yaml, docker.yaml) untouched: compilation
  happens inside Dockerfile.operator, not the Woodpecker step
This commit is contained in:
2026-10-02 23:40:40 +10:00
parent 44a927e81c
commit 1c4d2db5e8
2 changed files with 25 additions and 3 deletions
+12 -1
View File
@@ -3,10 +3,21 @@ when:
steps:
- name: pre-commit
image: golang:1.26
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands:
- test -z "$(gofmt -l cmd/ internal/)"
- go vet -mod=vendor ./...
environment:
GOCACHE_S3_BUCKET: gocache
GOCACHE_S3_REGION: us-east-1
GOCACHE_S3_ENDPOINT_URL: "https://s3.ceph.unkin.net"
GOCACHE_S3_PATH_STYLE: "true"
GOCACHE_KEY_PREFIX: ci-autobackup-operator
GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache"
AWS_ACCESS_KEY_ID:
from_secret: GOCACHE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY
backend_options:
kubernetes:
serviceAccountName: autobackup-operator-ci
+13 -2
View File
@@ -3,12 +3,23 @@ when:
steps:
- name: test
image: golang:1.26
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands:
# Fetch the envtest control-plane binaries; the controller tests skip
# gracefully if this cannot be downloaded.
- export KUBEBUILDER_ASSETS="$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use 1.31.0 -p path 2>/dev/null)"
- go test -race -count=1 -mod=vendor ./...
environment:
GOCACHE_S3_BUCKET: gocache
GOCACHE_S3_REGION: us-east-1
GOCACHE_S3_ENDPOINT_URL: "https://s3.ceph.unkin.net"
GOCACHE_S3_PATH_STYLE: "true"
GOCACHE_KEY_PREFIX: ci-autobackup-operator
GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache"
AWS_ACCESS_KEY_ID:
from_secret: GOCACHE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY
backend_options:
kubernetes:
serviceAccountName: autobackup-operator-ci
@@ -17,5 +28,5 @@ steps:
memory: 1Gi
cpu: 1
limits:
memory: 2Gi
memory: 4Gi
cpu: 2