From 22978ebd0efcebc10b7abef5611d35e2c0b031ba Mon Sep 17 00:00:00 2001 From: Bob Callaway Date: Mon, 16 Oct 2023 09:24:17 -0400 Subject: [PATCH] tell builder and build-dry about go.sum for go caching Signed-off-by: Bob Callaway --- .github/actions/generate-builder/action.yml | 1 + .github/actions/secure-project-checkout-go/action.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/actions/generate-builder/action.yml b/.github/actions/generate-builder/action.yml index 54f8d4d42c..3598fe7f87 100644 --- a/.github/actions/generate-builder/action.yml +++ b/.github/actions/generate-builder/action.yml @@ -79,6 +79,7 @@ runs: uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ inputs.go-version }} + cache-dependency-path: "__BUILDER_CHECKOUT_DIR__/go.sum" - name: Generate builder shell: bash diff --git a/.github/actions/secure-project-checkout-go/action.yml b/.github/actions/secure-project-checkout-go/action.yml index 3d7d885a16..e44c8ad3af 100644 --- a/.github/actions/secure-project-checkout-go/action.yml +++ b/.github/actions/secure-project-checkout-go/action.yml @@ -62,6 +62,7 @@ runs: if [ "${GO_VERSION_FILE}" != "" ]; then # NOTE: We use realpath to remove the trailing '/' if present. echo "go_version_file=${INPUT_PATH%%/}/${GO_VERSION_FILE}" >> "$GITHUB_OUTPUT" + echo "cache_dependency_path=${INPUT_PATH%%/}/go.sum" >> "$GITHUB_OUTPUT" fi - name: Set up Go environment @@ -69,3 +70,4 @@ runs: with: go-version: ${{ steps.validate.outputs.go_version }} go-version-file: ${{ steps.validate.outputs.go_version_file }} + cache-dependency-path: ${{ steps.validate.outputs.cache_dependency_path }}