From c4a28ddb57da2382bf77c20dcd7f6d777b9db839 Mon Sep 17 00:00:00 2001 From: Pete Steyert-Woods Date: Wed, 27 Nov 2024 14:53:45 +0000 Subject: [PATCH] Allow customising cache paths in `with-cache` command --- src/commands/with-cache.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/commands/with-cache.yml b/src/commands/with-cache.yml index 8bc3515..ff172bc 100644 --- a/src/commands/with-cache.yml +++ b/src/commands/with-cache.yml @@ -12,16 +12,28 @@ parameters: description: "Whether to use go-build cache." type: boolean default: true + build-path: + description: "Location of go-build cache." + type: string + default: "/home/circleci/.cache/go-build" mod: description: | Whether to use go module cache. If most of your dependencies are public, it is faster to use the public Go module proxy, so this defaults to `false`. type: boolean default: false + mod-path: + description: "Location of go module cache." + type: string + default: "/home/circleci/go/pkg/mod" golangci-lint: description: "Whether to use golangci-lint cache. Useful only in steps with linting, so defaults to false." type: boolean default: false + golangci-lint-path: + description: "Location of golangci-lint cache." + type: string + default: "/home/circleci/.cache/golangci-lint" steps: - when: condition: << parameters.build >> @@ -44,13 +56,16 @@ steps: steps: - save-build-cache: key: << parameters.key >> + path: << parameters.build-path >> - when: condition: << parameters.mod >> steps: - save-mod-cache: key: << parameters.key >> + path: << parameters.mod-path >> - when: condition: << parameters.golangci-lint >> steps: - save-golangci-lint-cache: key: << parameters.key >> + path: << parameters.golangci-lint-path >>