From e6243a3d9be5a53d9be991f412be993627c98cee Mon Sep 17 00:00:00 2001 From: Chris Guidry Date: Thu, 6 Aug 2026 09:02:50 -0400 Subject: [PATCH] Take ko from nixpkgs and share the Go caches between steps Installing ko with go install downloaded and compiled it on every run. The nixpkgs package removes that, and GOCACHE/GOMODCACHE under the shared workspace lets the image build reuse the coverage step's compilation. Co-Authored-By: Claude Fable 5 --- .tangled/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.tangled/workflows/ci.yml b/.tangled/workflows/ci.yml index 2fc247a..a701809 100644 --- a/.tangled/workflows/ci.yml +++ b/.tangled/workflows/ci.yml @@ -8,26 +8,29 @@ engine: "nixery" dependencies: nixpkgs: - - go - - gnugrep - - gawk - coreutils - docker + - gawk + - gnugrep + - go + - ko steps: - name: "Test with coverage" environment: CGO_ENABLED: "0" + GOCACHE: "/tangled/workspace/.cache/go-build" + GOMODCACHE: "/tangled/workspace/.cache/go-mod" command: | ./check-coverage - name: "Build and push image" environment: CGO_ENABLED: "0" + GOCACHE: "/tangled/workspace/.cache/go-build" + GOMODCACHE: "/tangled/workspace/.cache/go-mod" KO_DOCKER_REPO: "atcr.io/guid.foo/wicket" command: | - go install github.com/google/ko@latest - export PATH="$(go env GOPATH)/bin:$PATH" export VERSION="$(date -u +%Y%m%d%H%M%S)-$(git rev-parse --short HEAD)" echo "${ATCR_APP_PASSWORD}" | docker login atcr.io -u guid.foo --password-stdin ko build --bare --tags "latest,${VERSION}" . -- 2.51.2