forked from spiffe/spire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change GH workflow tools cache key (spiffe#3871)
Current cache key causes each job to upload to the cache with the commit sha based key. This causes two problems: 1. Cache entries is large (one per PR) for no benefit 2. Toolchain changes are not considered when reusing the cache This change updates the cache key for the tools cache to essentially be keyed off of the Go version and the Makefile (which contains the versions of tools in use) Signed-off-by: Andrew Harding <[email protected]>
- Loading branch information
Showing
2 changed files
with
14 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,9 +54,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Lint | ||
run: make lint | ||
- name: Tidy check | ||
|
@@ -138,9 +136,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Build artifacts | ||
run: ./.github/workflows/scripts/build_artifacts.sh | ||
- name: Archive artifacts | ||
|
@@ -173,9 +169,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # ratchet:docker/[email protected] | ||
- name: Set up Docker Buildx | ||
|
@@ -255,9 +249,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Download archived images | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # ratchet:actions/[email protected] | ||
with: | ||
|
@@ -302,9 +294,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|
@@ -373,9 +363,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|
@@ -450,9 +438,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Lint | ||
run: make lint | ||
- name: Tidy check | ||
|
@@ -136,9 +134,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Build artifacts | ||
run: ./.github/workflows/scripts/build_artifacts.sh | ||
- name: Archive artifacts | ||
|
@@ -171,9 +167,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Build images | ||
run: make images | ||
- name: Export images | ||
|
@@ -258,9 +252,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Download archived images | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # ratchet:actions/[email protected] | ||
with: | ||
|
@@ -307,9 +299,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|
@@ -378,9 +368,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|
@@ -455,9 +443,7 @@ jobs: | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # ratchet:actions/[email protected] | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }} | ||
- name: Install msys2 | ||
uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # ratchet:msys2/setup-msys2@v2 | ||
with: | ||
|