Skip to content

ci: skip cache update on PRs. #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- uses: actions/checkout@v2

- name: Bazel cache
uses: actions/cache@v2
uses: PiotrSikora/cache@v2.1.7-with-skip-cache
with:
path: |
~/.cache/bazel
Expand All @@ -88,7 +88,12 @@ jobs:
if-no-files-found: error
retention-days: 3

- name: Skip Bazel cache update
if: ${{ github.ref != 'refs/heads/master' }}
run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV

- name: Cleanup Bazel cache
if: ${{ github.ref == 'refs/heads/master' }}
run: |
export OUTPUT=$(bazel info output_base)
# Distfiles for Rust toolchains (350 MiB).
Expand Down Expand Up @@ -179,15 +184,14 @@ jobs:

- name: Bazel cache
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
uses: actions/cache@v2
uses: PiotrSikora/cache@v2.1.7-with-skip-cache
with:
path: |
~/.cache/bazel
/private/var/tmp/_bazel_runner/
key: ${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
restore-keys: |
${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}-
${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}

- name: Download test data
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -224,8 +228,12 @@ jobs:
--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-)\"
//test:signature_util_test

- name: Skip Bazel cache update
if: ${{ github.ref != 'refs/heads/master' && (matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker')) }}
run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV

- name: Cleanup Bazel cache
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
if: ${{ github.ref == 'refs/heads/master' && (matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker')) }}
run: |
export OUTPUT=$(bazel info output_base)
# BoringSSL's test data (90 MiB).
Expand Down