Skip to content

Commit 3815e8b

Browse files
Fix test yaml repo cloning for test_and_docs workflow (#470)
1 parent 927fcd9 commit 3815e8b

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,19 @@ jobs:
2020
code:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- name: Checkout repository
23+
- name: Checkout repository (Handle all events)
2424
uses: actions/checkout@v4.2.2
25-
- name: Cache Bazel and pip
26-
uses: actions/cache@v4
2725
with:
28-
path: |
29-
~/.cache/bazel
30-
~/.cache/pip
31-
key: ${{ runner.os }}-test-${{ hashFiles('**/*.bazel', '**/BUILD', '**/*.bzl', 'src/requirements.txt', 'src/**/*.py') }}
26+
ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }}
27+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
3228

33-
- name: Setup Bazel with cache
34-
uses: bazel-contrib/setup-bazel@0.15.0
29+
- name: Setup Bazel with shared caching
30+
uses: bazel-contrib/setup-bazel@0.18.0
3531
with:
3632
disk-cache: true
3733
repository-cache: true
3834
bazelisk-cache: true
35+
cache-save: ${{ github.event_name == 'push' }}
3936
- name: Run test targets
4037
run: |
4138
bazel run --lockfile_mode=error //:ide_support

0 commit comments

Comments
 (0)