From 07fefcb40d9f5c611e985f60b3500a740de6a1f5 Mon Sep 17 00:00:00 2001 From: Roo Thorp Date: Tue, 12 Mar 2024 13:35:14 +0000 Subject: [PATCH] cache on go.mod as well as go.sum --- .github/actions/build-push-image/action.yaml | 2 +- .github/workflows/check-licenses.yml | 2 +- .github/workflows/rebuild-released-images.yaml | 2 +- .github/workflows/test-e2e.yml | 4 ++-- .github/workflows/test-int.yml | 2 +- .github/workflows/test-unit.yml | 2 +- .github/workflows/validate-manifests.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/build-push-image/action.yaml b/.github/actions/build-push-image/action.yaml index 7ecac3903a..dd9b150092 100644 --- a/.github/actions/build-push-image/action.yaml +++ b/.github/actions/build-push-image/action.yaml @@ -81,7 +81,7 @@ runs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Download go build dependencies shell: bash run: | diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 911fb31d15..bdd0410de3 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -16,7 +16,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Setup Go uses: actions/setup-go@v5 diff --git a/.github/workflows/rebuild-released-images.yaml b/.github/workflows/rebuild-released-images.yaml index 9f2cd9bc28..1ac4163627 100644 --- a/.github/workflows/rebuild-released-images.yaml +++ b/.github/workflows/rebuild-released-images.yaml @@ -89,7 +89,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Download go build dependencies shell: bash run: | diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 56f15bf19e..4c96d0765d 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -90,7 +90,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Get go dependencies if cache is missed if: steps.cache-go.outputs.cache-hit != 'true' run: | @@ -177,7 +177,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Get go dependencies if cache is missed if: steps.get-go-deps.outputs.cache-hit != 'true' run: | diff --git a/.github/workflows/test-int.yml b/.github/workflows/test-int.yml index c30eeb156b..251ba480df 100644 --- a/.github/workflows/test-int.yml +++ b/.github/workflows/test-int.yml @@ -42,7 +42,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Setup Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index f9073193ab..1bdfe222bc 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -16,7 +16,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Setup Go uses: actions/setup-go@v5 diff --git a/.github/workflows/validate-manifests.yml b/.github/workflows/validate-manifests.yml index 37c066dcf0..248e7ce310 100644 --- a/.github/workflows/validate-manifests.yml +++ b/.github/workflows/validate-manifests.yml @@ -16,7 +16,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum', '**/go.mod') }} - name: Setup Go uses: actions/setup-go@v5