Skip to content

Commit 70b85cd

Browse files
authored
ci: fix bazel cache (#1197)
* ci: fix bazel cache * ci: fix bazel cache in all locations
1 parent d58b2e5 commit 70b85cd

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

.github/workflows/ci-maven.yaml

+5-7
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ jobs:
124124
uses: actions/cache@v3
125125
with:
126126
path: ~/.cache/bazel
127-
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
127+
key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
128+
restore-keys: ${{ runner.os }}-
128129
- name: Bazel Cache Not Found
129130
if: steps.cache-bazel.outputs.cache-hit != 'true'
130131
run: |
@@ -133,12 +134,9 @@ jobs:
133134
if: steps.cache-bazel.outputs.cache-hit == 'true'
134135
run: |
135136
echo -n "Cache found. Cache size: "
136-
du -sh ~/.cache/bazel
137-
echo "If the cache seems broken, update the CACHE_VERSION secret in"
138-
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
139-
echo "(use any random string, any GUID will work)"
140-
echo "and it will start over with a clean cache."
141-
echo "The old one will disappear after 7 days."
137+
du -sh ~/.cache/bazel
138+
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
139+
echo "The old cache will disappear after 7 days."
142140
143141
- name: Install maven modules
144142
run: |

.github/workflows/ci.yaml

+7-13
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
uses: actions/cache@v3
2525
with:
2626
path: ~/.cache/bazel
27-
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
28-
27+
key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
28+
restore-keys: ${{ runner.os }}-
2929
- name: Bazel Cache Not Found
3030
if: steps.cache-bazel.outputs.cache-hit != 'true'
3131
run: |
@@ -35,10 +35,7 @@ jobs:
3535
run: |
3636
echo -n "Cache found. Cache size: "
3737
du -sh ~/.cache/bazel
38-
echo "If the cache seems broken, update the CACHE_VERSION secret in"
39-
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
40-
echo "(use any random string, any GUID will work)"
41-
echo "and it will start over with a clean cache."
38+
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
4239
echo "The old one will disappear after 7 days."
4340
4441
- name: Integration Tests
@@ -70,8 +67,8 @@ jobs:
7067
uses: actions/cache@v3
7168
with:
7269
path: ~/.cache/bazel
73-
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
74-
70+
key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
71+
restore-keys: ${{ runner.os }}-
7572
- name: Bazel Cache Not Found
7673
if: steps.cache-bazel.outputs.cache-hit != 'true'
7774
run: |
@@ -81,11 +78,8 @@ jobs:
8178
run: |
8279
echo -n "Cache found. Cache size: "
8380
du -sh ~/.cache/bazel
84-
echo "If the cache seems broken, update the CACHE_VERSION secret in"
85-
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
86-
echo "(use any random string, any GUID will work)"
87-
echo "and it will start over with a clean cache."
88-
echo "The old one will disappear after 7 days."
81+
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
82+
echo "The old cache will disappear after 7 days."
8983
9084
- name: Gradle Build Generated Storage Client Library
9185
run: |

0 commit comments

Comments
 (0)