From 5e4d4188f4ca15a0743746a475d98fbc419fe266 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sun, 26 Feb 2023 12:20:11 +0100 Subject: [PATCH] circleci: use orb circlci/go for module caching --- .circleci/config.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e5f8ee..8108c9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,8 @@ version: 2.1 - +orbs: + # NB: 1.7.2 is not the Go version, but the Orb version + # https://circleci.com/developer/orbs/orb/circleci/go#usage-go-modules-cache + go: circleci/go@1.7.2 commands: setup-home-local-bin: steps: @@ -31,17 +34,6 @@ commands: # The need for this was required for cimg/go:1.12, but let's future proof this here and now. - run: sudo apt-get install -y git ca-certificates - restore-cache-gomod: - steps: - - restore_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - save-cache-gomod: - steps: - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - install-godep: steps: - apt-update-and-install-common-deps @@ -179,12 +171,13 @@ jobs: steps: - checkout + - go/load-cache: + key: quickcheck-<> - install-godep - - - restore-cache-gomod - run: go mod download - run: cd build && go mod download - - save-cache-gomod + - go/save-cache: + key: quickcheck-<> - run: make formatcheck - run: make generate-platform-test-list @@ -229,9 +222,11 @@ jobs: - image: cimg/go:<> steps: - checkout - - restore-cache-gomod + - go/load-cache: + key: make-test-go - run: make test-go - # don't save-cache-gomod here, test-go doesn't pull all the dependencies + - go/save-cache: + key: make-test-go release-build: machine: