Skip to content

Commit

Permalink
update bazel cache scheme to match upstream example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemnmez committed May 30, 2023
1 parent 8f49565 commit c280ae1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 //...
16 changes: 9 additions & 7 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit c280ae1

Please sign in to comment.