Switch Go CI steps to gobuilder + S3 build cache
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:
@@ -3,10 +3,21 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: pre-commit
|
- name: pre-commit
|
||||||
image: golang:1.26
|
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
|
||||||
commands:
|
commands:
|
||||||
- test -z "$(gofmt -l cmd/ internal/)"
|
- test -z "$(gofmt -l cmd/ internal/)"
|
||||||
- go vet -mod=vendor ./...
|
- 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:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
serviceAccountName: autobackup-operator-ci
|
serviceAccountName: autobackup-operator-ci
|
||||||
|
|||||||
+13
-2
@@ -3,12 +3,23 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test
|
||||||
image: golang:1.26
|
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
|
||||||
commands:
|
commands:
|
||||||
# Fetch the envtest control-plane binaries; the controller tests skip
|
# Fetch the envtest control-plane binaries; the controller tests skip
|
||||||
# gracefully if this cannot be downloaded.
|
# 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)"
|
- 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 ./...
|
- 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:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
serviceAccountName: autobackup-operator-ci
|
serviceAccountName: autobackup-operator-ci
|
||||||
@@ -17,5 +28,5 @@ steps:
|
|||||||
memory: 1Gi
|
memory: 1Gi
|
||||||
cpu: 1
|
cpu: 1
|
||||||
limits:
|
limits:
|
||||||
memory: 2Gi
|
memory: 4Gi
|
||||||
cpu: 2
|
cpu: 2
|
||||||
|
|||||||
Reference in New Issue
Block a user