Skip to content

Commit

Permalink
ci: fix bazel cache (#1197)
Browse files Browse the repository at this point in the history
* ci: fix bazel cache

* ci: fix bazel cache in all locations
  • Loading branch information
burkedavison authored Dec 22, 2022
1 parent d58b2e5 commit 70b85cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci-maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
restore-keys: ${{ runner.os }}-
- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
Expand All @@ -133,12 +134,9 @@ jobs:
if: steps.cache-bazel.outputs.cache-hit == 'true'
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
echo "The old cache will disappear after 7 days."
- name: Install maven modules
run: |
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}

key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
restore-keys: ${{ runner.os }}-
- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
Expand All @@ -35,10 +35,7 @@ jobs:
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
echo "The old one will disappear after 7 days."
- name: Integration Tests
Expand Down Expand Up @@ -70,8 +67,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}

key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
restore-keys: ${{ runner.os }}-
- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
Expand All @@ -81,11 +78,8 @@ jobs:
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."
echo "If the cache seems broken, update the root WORKSPACE file with a trivial change."
echo "The old cache will disappear after 7 days."
- name: Gradle Build Generated Storage Client Library
run: |
Expand Down

0 comments on commit 70b85cd

Please sign in to comment.