Skip to content

Commit

Permalink
ci: set bazlrc options for "common" instead of "build" if they should…
Browse files Browse the repository at this point in the history
… always apply (#2227)

Most flags set in the bazelrc in CI are always applicable, so we set them with the common prefix.
  • Loading branch information
malt3 authored Aug 15, 2023
1 parent 310b80c commit 5c1bca5
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions .github/actions/setup_bazel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,24 @@ runs:
run: |
echo "::group::Configure Bazel"
cat <<EOF >> "${WORKSPACE}/.bazeloverwriterc"
build --color=yes
build --terminal_columns=143
build --build_metadata=ROLE=CI
build --show_progress_rate_limit=5
build --curses=yes
build --verbose_failures
build --announce_rc
# general
common --color=yes
common --terminal_columns=143
common --build_metadata=ROLE=CI
common --show_progress_rate_limit=5
common --curses=yes
common --verbose_failures
common --announce_rc
# test related
test --show_timestamps
test --keep_going
# remote cache / execution related
common --bes_timeout=600s
common --experimental_remote_build_event_upload=minimal
common --experimental_remote_cache_compression
common --nolegacy_important_outputs
common --noremote_upload_local_results
common --remote_timeout=3600
EOF
echo "::endgroup::"
Expand All @@ -55,16 +64,10 @@ runs:
run: |
echo "::group::Configure Bazel"
cat <<EOF >> "${WORKSPACE}/.bazeloverwriterc"
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://remote.buildbuddy.io
build --bes_timeout=600s
build --remote_cache=grpcs://remote.buildbuddy.io
build --remote_timeout=3600
build --experimental_remote_build_event_upload=minimal
build --experimental_remote_cache_compression
build --noremote_upload_local_results
build --nolegacy_important_outputs
build --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}
common --bes_results_url=https://app.buildbuddy.io/invocation/
common --bes_backend=grpcs://remote.buildbuddy.io
common --remote_cache=grpcs://remote.buildbuddy.io
common --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}
EOF
echo "::endgroup::"
Expand All @@ -75,7 +78,7 @@ runs:
WORKSPACE: ${{ github.workspace }}
run: |
echo "::group::Configure Bazel (readonly)"
echo "build --remote_upload_local_results=false" >> "${WORKSPACE}/.bazeloverwriterc"
echo "common --remote_upload_local_results=false" >> "${WORKSPACE}/.bazeloverwriterc"
echo "::endgroup::"
- name: Configure Bazel (logs)
Expand All @@ -87,11 +90,9 @@ runs:
run: |
echo "::group::Configure Bazel"
cat <<EOF >> "${WORKSPACE}/.bazeloverwriterc"
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://remote.buildbuddy.io
build --bes_timeout=600s
build --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}
build --nolegacy_important_outputs
common --bes_results_url=https://app.buildbuddy.io/invocation/
common --bes_backend=grpcs://remote.buildbuddy.io
common --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}
EOF
echo "::endgroup::"
Expand All @@ -102,8 +103,8 @@ runs:
if: startsWith(runner.name , 'GitHub Actions')
run: |
echo "::group::Configure Bazel (disk cache)"
echo "build --disk_cache=" >> "${WORKSPACE}/.bazeloverwriterc"
echo "build --repository_cache=" >> "${WORKSPACE}/.bazeloverwriterc"
echo "common --disk_cache=" >> "${WORKSPACE}/.bazeloverwriterc"
echo "common --repository_cache=" >> "${WORKSPACE}/.bazeloverwriterc"
echo "::endgroup::"
- name: Check bazel version
Expand Down

0 comments on commit 5c1bca5

Please sign in to comment.