|
66 | 66 | - uses: actions/checkout@v2 |
67 | 67 |
|
68 | 68 | - name: Bazel cache |
69 | | - uses: actions/cache@v2 |
| 69 | + uses: PiotrSikora/cache@v2.1.7-with-skip-cache |
70 | 70 | with: |
71 | 71 | path: | |
72 | 72 | ~/.cache/bazel |
|
88 | 88 | if-no-files-found: error |
89 | 89 | retention-days: 3 |
90 | 90 |
|
| 91 | + - name: Skip Bazel cache update |
| 92 | + if: ${{ github.ref != 'refs/heads/master' }} |
| 93 | + run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV |
| 94 | + |
91 | 95 | - name: Cleanup Bazel cache |
| 96 | + if: ${{ github.ref == 'refs/heads/master' }} |
92 | 97 | run: | |
93 | 98 | export OUTPUT=$(bazel info output_base) |
94 | 99 | # Distfiles for Rust toolchains (350 MiB). |
@@ -179,15 +184,14 @@ jobs: |
179 | 184 |
|
180 | 185 | - name: Bazel cache |
181 | 186 | if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }} |
182 | | - uses: actions/cache@v2 |
| 187 | + uses: PiotrSikora/cache@v2.1.7-with-skip-cache |
183 | 188 | with: |
184 | 189 | path: | |
185 | 190 | ~/.cache/bazel |
186 | 191 | /private/var/tmp/_bazel_runner/ |
187 | 192 | key: ${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} |
188 | 193 | restore-keys: | |
189 | 194 | ${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}- |
190 | | - ${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }} |
191 | 195 |
|
192 | 196 | - name: Download test data |
193 | 197 | uses: actions/download-artifact@v2 |
@@ -224,8 +228,12 @@ jobs: |
224 | 228 | --per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" |
225 | 229 | //test:signature_util_test |
226 | 230 |
|
| 231 | + - name: Skip Bazel cache update |
| 232 | + if: ${{ github.ref != 'refs/heads/master' && (matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker')) }} |
| 233 | + run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV |
| 234 | + |
227 | 235 | - name: Cleanup Bazel cache |
228 | | - if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }} |
| 236 | + if: ${{ github.ref == 'refs/heads/master' && (matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker')) }} |
229 | 237 | run: | |
230 | 238 | export OUTPUT=$(bazel info output_base) |
231 | 239 | # BoringSSL's test data (90 MiB). |
|
0 commit comments