From 42667fedc660e11f6fab8a40dcf5b9c74c87479b Mon Sep 17 00:00:00 2001 From: Derek Cormier Date: Mon, 17 Jan 2022 14:39:29 -0800 Subject: [PATCH] build: fix ci cacheing to use recently built caches --- .github/workflows/ci.yaml | 14 ++++++-------- .github/workflows/release.yml | 6 ++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 480853b..1f0bc17 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,16 +20,14 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - name: Mount bazel action cache + - name: Mount bazel caches uses: actions/cache@v2 with: - path: "~/.cache/bazel" - key: bazel - - name: Mount bazel repo cache - uses: actions/cache@v2 - with: - path: "~/.cache/bazel-repo" - key: bazel-repo + path: | + "~/.cache/bazel" + "~/.cache/bazel-repo" + key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} + restore-keys: bazel-cache- - name: bazel test //... env: # Bazelisk will download bazel to here, ensure it is cached between runs. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f21c3c..8fac6a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Mount bazel repo cache + uses: actions/cache@v2 + with: + path: "~/.cache/bazel-repo" + key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} + restore-keys: bazel-cache- - name: bazel test //... env: # Bazelisk will download bazel to here