Skip to content

Commit 866c39d

Browse files
committed
Use the setup-bazel action to share the bazel cache between workflows.
Suggested by jeongik@. Bug: b/385208338
1 parent d14191d commit 866c39d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/presubmit.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
# debian:bullseye
2828
image: debian@sha256:3b6053ca925336c804e2d3f080af177efcdc9f51198a627569bfc7c7e730ef7e
2929
steps:
30+
- name: Common bazel setup
31+
uses: bazel-contrib/setup-bazel@f3f50ea6791b9b0f4c4eeabba4507422426462f5 #aka 0.9.1
32+
with:
33+
bazelisk-cache: true # Avoid downloading Bazel every time.
34+
disk-cache: ${{ github.workflow }} # Store build cache per workflow.
35+
repository-cache: true # Share repository cache between workflows.
3036
- name: Check for dockerenv file
3137
run: (ls /.dockerenv && echo 'Found dockerenv') || (echo 'No dockerenv')
3238
- name: setup apt
@@ -56,6 +62,12 @@ jobs:
5662
container:
5763
image: debian@sha256:3b6053ca925336c804e2d3f080af177efcdc9f51198a627569bfc7c7e730ef7e
5864
steps:
65+
- name: Common bazel setup
66+
uses: bazel-contrib/setup-bazel@f3f50ea6791b9b0f4c4eeabba4507422426462f5 #aka 0.9.1
67+
with:
68+
bazelisk-cache: true # Avoid downloading Bazel every time.
69+
disk-cache: ${{ github.workflow }} # Store build cache per workflow.
70+
repository-cache: true # Share repository cache between workflows.
5971
- name: Checkout repository
6072
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
6173
- name: Setup apt
@@ -78,6 +90,12 @@ jobs:
7890
e2e-tests-orchestration:
7991
runs-on: ubuntu-22.04
8092
steps:
93+
- name: Common bazel setup
94+
uses: bazel-contrib/setup-bazel@f3f50ea6791b9b0f4c4eeabba4507422426462f5 #aka 0.9.1
95+
with:
96+
bazelisk-cache: true # Avoid downloading Bazel every time.
97+
disk-cache: ${{ github.workflow }} # Store build cache per workflow.
98+
repository-cache: true # Share repository cache between workflows.
8199
- name: Free space
82100
run: |
83101
echo "disk space before cleanup:"

0 commit comments

Comments
 (0)