diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e0ce7c..bf0babd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -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: @@ -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