Skip to content

Commit a222cf2

Browse files
authored
[build] add GitHub Cache workflow to generate and save bazel repository-cache (#17575)
* [build] add Github Cache workflow and cancel-on-failure guard in bazel.yml * [build] remove cancel-on-failure guard
1 parent 2963535 commit a222cf2

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/bazel.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ jobs:
166166
bazelrc: common --color=yes
167167
# Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532
168168
output-base: ${{ inputs.os == 'windows' && 'D://b' || '' }}
169-
cache-version: 2
170169
disk-cache: false
171170
external-cache: |
172171
manifest:

.github/workflows/gh-cache.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
name: CI Cache
1+
name: GitHub Cache
22

33
on:
4+
push:
5+
branches: [trunk]
6+
paths:
7+
- 'MODULE.bazel'
8+
- 'multitool.lock.json'
9+
- 'pnpm-lock.yaml'
10+
- 'rust/Cargo.lock'
11+
- 'java/maven_install.json'
12+
- 'py/requirements_lock.txt'
13+
- 'rb/Gemfile.lock'
14+
- 'dotnet/paket.lock'
15+
- 'common/repositories.bzl'
16+
- 'common/browsers.bzl'
17+
schedule:
18+
- cron: '30 6 * * *'
419
workflow_dispatch:
520

621
concurrency:
7-
group: ci-cache-${{ github.ref }}
22+
group: gh-cache-${{ github.ref }}
823
cancel-in-progress: true
924

1025
permissions:
@@ -21,9 +36,8 @@ jobs:
2136
with:
2237
name: ${{ matrix.os }}
2338
os: ${{ matrix.os }}
24-
cache-save: false
25-
run: >
26-
bazel build --nobuild --build_tests_only --keep_going
27-
--repo_contents_cache=
28-
//java/... //py/... //rb/... //rust/...
29-
//javascript/selenium-webdriver/... //dotnet/...
39+
cache-save: true
40+
run: >-
41+
bazel build --nobuild --build_tests_only --keep_going --repo_contents_cache=
42+
//java/test/... //py:* //rb/spec/... //rust/tests/...
43+
//javascript/selenium-webdriver:* //dotnet/test/...

0 commit comments

Comments
 (0)