From c280ae1816c10916006b3caf7c2f97f047b267cd Mon Sep 17 00:00:00 2001 From: Thomas Neil James Shadwell Date: Wed, 31 May 2023 00:03:43 +0900 Subject: [PATCH] update bazel cache scheme to match upstream example --- .github/workflows/ci.yml | 18 +++++++++++------- .github/workflows/deployment.yml | 16 +++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 600b771c5c..9f7a4047f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,16 +53,20 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16' - - name: Restore bazel cache - uses: actions/cache@v3.3.1 - env: - cache-name: bazel-cache + # example copied from: + # https://github.com/actions/cache/blob/04f198bf0b2a39f7230a4304bf07747a0bddf146/examples.md + - name: Cache Bazel + uses: actions/cache@v3 with: path: | - ~/.cache/bazelisk ~/.cache/bazel - key: ${{ runner.os }}-${{ env.cache-name }} + key: > + ${{ runner.os }}-bazel-${{ + hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', + 'WORKSPACE.bazel', 'MODULE.bazel') }} + restore-keys: | + ${{ runner.os }}-bazel- - name: All tests # Use npx to try to generate only # bazel generated node_modules - run: bazelisk test //... + run: bazel test //... diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index abea2ef208..d64325430c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -22,19 +22,21 @@ jobs: with: registry-url: 'https://registry.npmjs.org' node-version: '16' - - name: Restore bazel cache - uses: actions/cache@v3.3.1 - env: - cache-name: bazel-cache + - name: Cache Bazel + uses: actions/cache@v3 with: path: | - ~/.cache/bazelisk ~/.cache/bazel - key: ${{ runner.os }}-${{ env.cache-name }} + key: > + ${{ runner.os }}-bazel-${{ + hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', + 'WORKSPACE.bazel', 'MODULE.bazel') }} + restore-keys: | + ${{ runner.os }}-bazel- - name: Deploy # Use npx to try to generate only # bazel generated node_modules - run: bazelisk run //deploy:deploy + run: bazel run //deploy:deploy shell: bash env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}