Skip to content

Commit

Permalink
Use cache for non-scheduled jobs (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyawk authored Nov 6, 2024
1 parent cdb3855 commit 71ac6cc
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Look up cache if it's not a scheduled job
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache
key: ${{ github.repository }}-${{ github.job }}-${{ matrix.bazel-version }}-${{ runner.os }}-${{ hashFiles('.bazelrc', 'WORKSPACE', 'MODULE.bazel') }}
restore-keys: ${{ github.repository }}-${{ github.job }}-${{ matrix.bazel-version }}-${{ runner.os }}-
- name: Set up
uses: ./.github/actions/setup
with:
Expand Down Expand Up @@ -63,6 +70,13 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Look up cache if it's not a scheduled job
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/examples/.cache
key: ${{ github.repository }}-${{ github.job }}-${{ matrix.bazel-version }}-${{ runner.os }}-${{ hashFiles('.bazelrc', 'WORKSPACE', 'MODULE.bazel', 'examples/.bazelrc', 'examples/WORKSPACE', 'examples/MODULE.bazel') }}
restore-keys: ${{ github.repository }}-${{ github.job }}-${{ matrix.bazel-version }}-${{ runner.os }}-
- name: Set up
uses: ./.github/actions/setup
with:
Expand All @@ -73,15 +87,24 @@ jobs:

style-check:
runs-on: ubuntu-latest
env:
bazel-version: 7.x
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Look up cache if it's not a scheduled job
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache
key: ${{ github.repository }}-${{ github.job }}-${{ env.bazel-version }}-${{ runner.os }}-${{ hashFiles('.bazelrc', 'WORKSPACE', 'MODULE.bazel') }}
restore-keys: ${{ github.repository }}-${{ github.job }}-${{ env.bazel-version }}-${{ runner.os }}-
- name: Set up
uses: ./.github/actions/setup
with:
bazel-version: 7.x
bazel-version: ${{ env.bazel-version }}
- name: Run formatters and linters
shell: bash
run: ./development/cli/style_check.bash
Expand Down

0 comments on commit 71ac6cc

Please sign in to comment.