diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a84dcce1..74ff641e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,10 +98,12 @@ jobs: ~/.cache/bazel ~/.cache/bazel-repo key: >- + v3-bazel-repo-cache + -${{ matrix.external_dependency_system }}-${{ matrix.toolchain }} + -${{ hashFiles('.bazelversion', '**/WORKSPACE', '**/MODULE.bazel' 'repositories/**/*.bzl', 'requirements_lock.txt') }} + restore-keys: >- v3-bazel-repo-cache -${{ matrix.external_dependency_system }}-${{ matrix.toolchain }}- - -${{ github.event.pull_request.number || github.ref }} - restore-keys: v3-bazel-repo-cache-${{ matrix.external_dependency_system }}-${{ matrix.toolchain }}- - name: bazel test //... env: # Bazelisk will download bazel to here, ensure it is cached between runs. @@ -113,3 +115,14 @@ jobs: ${GITHUB_WORKSPACE}/.github/workflows/test.sh ${{ matrix.config_option }} ${{ matrix.bzlmod_flags }} + + - uses: actions/cache/save@v3 + if: always() + with: + path: | + ~/.cache/bazel + ~/.cache/bazel-repo + key: >- + v3-bazel-repo-cache + -${{ matrix.external_dependency_system }}-${{ matrix.toolchain }} + -${{ hashFiles('.bazelversion', '**/WORKSPACE', '**/MODULE.bazel' 'repositories/**/*.bzl', 'requirements_lock.txt') }}