Skip to content

Commit 84d9abe

Browse files
committed
Update key and restore-key for the actions/cache action in actions
The github actions cache works better when individual runs have unique keys, otherwise I believe the contents are never updated
1 parent fb9b537 commit 84d9abe

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.github/workflows/oci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ jobs:
4545
uses: actions/[email protected]
4646
with:
4747
path: "/home/runner/repo-cache/"
48-
key: repo-cache
48+
key: ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }}
49+
restore-keys: |
50+
${{ runner.os }}-repo-cache-
4951
5052
- name: Configure Bazel
5153
run: |

.github/workflows/rabbitmq_peer_discovery_aws.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
uses: actions/[email protected]
2626
with:
2727
path: "/home/runner/repo-cache/"
28-
key: repo-cache
28+
key: ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }}
29+
restore-keys: |
30+
${{ runner.os }}-repo-cache-
2931
- name: CONFIGURE BAZEL
3032
run: |
3133
cat << EOF >> user.bazelrc

.github/workflows/test-erlang-git.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
uses: actions/[email protected]
1616
with:
1717
path: "/home/runner/repo-cache/"
18-
key: repo-cache
18+
key: ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }}
19+
restore-keys: |
20+
${{ runner.os }}-repo-cache-
1921
- name: CONFIGURE BAZEL
2022
run: |
2123
if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then

.github/workflows/test-mixed-versions.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ jobs:
7575
uses: actions/[email protected]
7676
with:
7777
path: "/home/runner/repo-cache/"
78-
key: repo-cache-secondary-umbrella
78+
key: repo-cache-secondary-umbrella-${{ hashFiles('primary-umbrella/MODULE.bazel','primary-umbrella/WORKSPACE','primary-umbrella/bazel/bzlmod/secondary_umbrella.bzl') }}
79+
restore-keys: |
80+
repo-cache-secondary-umbrella-
7981
- name: BUILD SECONDARY UMBRELLA ARCHIVE
8082
if: env.exists != 'true'
8183
working-directory: secondary-umbrella

0 commit comments

Comments
 (0)