chore: Clean up cache usage in workflows (#6444)
* chore: Use same cache as bats tests * chore: Clarify cache miss check * chore: Remove use of setup-go cache * chore: Use separate caches * CR
This commit is contained in:
1 parent
c1eae29f24
commit
9c0ea988f5
9 files changed
+184
-126
No files matched your search
+18
-15
@@ -59,21 +59,20 @@ jobs:
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
${{ steps.go-cache-paths.outputs.go-mod }}
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
key: go-mod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
go-mod
|
||||
- name: Determine product edition
|
||||
id: get-product-edition
|
||||
# Run make edition twice to ensure that extra go output isn't included
|
||||
run: |
|
||||
go mod download
|
||||
make edition
|
||||
echo "product-edition=$(make edition)" >> "$GITHUB_OUTPUT"
|
||||
- name: Determine minor product version
|
||||
@@ -150,17 +149,15 @@ jobs:
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
${{ steps.go-cache-paths.outputs.go-mod }}
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.goarch }}
|
||||
key: go-mod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
go-mod
|
||||
- name: Set up Git
|
||||
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
|
||||
- name: Determine SHA
|
||||
@@ -226,11 +223,19 @@ jobs:
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
${{ steps.go-cache-paths.outputs.go-mod }}
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.goarch }}
|
||||
key: go-mod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
go-mod
|
||||
# Adding go build cache here since this build is used for tests
|
||||
- name: Set up Go build cache
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
key: go-build-${{ needs.product-metadata.outputs.go-version }}-${{ runner.os }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
go-build-${{ needs.product-metadata.outputs.go-version }}-${{ runner.os }}-${{ matrix.goarch }}-
|
||||
- name: Determine SHA
|
||||
id: set-sha
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||
@@ -320,17 +325,15 @@ jobs:
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
${{ steps.go-cache-paths.outputs.go-mod }}
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
key: go-mod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
go-mod
|
||||
- name: Determine SHA
|
||||
id: set-sha
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
Reference in new issue
Block a user