Skip to content

Commit 9c9e8b0

Browse files
committed
use remote build when on main
1 parent 5bf27a0 commit 9c9e8b0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
labels: ubuntu-24.04-64core
1717
env:
1818
BUILDBUDDY_API_KEY: ${{ github.event_name != 'pull_request' && secrets.BUILDBUDDY_API_KEY || '7eYz4UY70YSrT55wmjWV' }}
19+
BAZEL_REMOTE_FLAG: ${{ github.ref_name == 'main' && '--config=remote' || '' }}
1920
steps:
2021
- name: Check out repository code
2122
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -39,14 +40,14 @@ jobs:
3940
- name: "Run `bazel build`"
4041
run: |
4142
bazel build -c opt \
42-
--config=ci \
43+
--config=ci "$BAZEL_REMOTE_FLAG" \
4344
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
4445
//...
4546
4647
- name: "Run `bazel test`"
4748
run: |
4849
bazel test -c opt \
49-
--config=ci \
50+
--config=ci "$BAZEL_REMOTE_FLAG" \
5051
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
5152
//...
5253

.github/workflows/docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
contents: write
1818
env:
1919
BUILDBUDDY_API_KEY: ${{ github.event_name != 'pull_request' && secrets.BUILDBUDDY_API_KEY || '7eYz4UY70YSrT55wmjWV' }}
20+
BAZEL_REMOTE_FLAG: ${{ github.ref_name == 'main' && '--config=remote' || '' }}
2021
steps:
2122
- name: Checkout
2223
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -46,7 +47,7 @@ jobs:
4647
run: |
4748
bazel query "filter('_filegroup', siblings(kind('gentbl_rule', @heir//...)))" | \
4849
xargs bazel build -c opt \
49-
--config=ci \
50+
--config=ci "$BAZEL_REMOTE_FLAG" \
5051
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
5152
"$@"
5253
@@ -56,7 +57,7 @@ jobs:
5657
python -m pip install pyyaml==6.0.2 fire==0.7.0
5758
# heir-opt is needed to generate the doctest examples
5859
bazel build -c opt \
59-
--config=ci \
60+
--config=ci "$BAZEL_REMOTE_FLAG" \
6061
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
6162
//tools:heir-opt
6263
python -m scripts.docs.copy_tblgen_files

0 commit comments

Comments
 (0)