Skip to content

Commit

Permalink
chore: switch to Buildbuddy for RBE testing (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Oct 2, 2023
1 parent 70a8c93 commit 8c414dc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 85 deletions.
20 changes: 20 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,24 @@ build:ubsan --features ubsan
build:ubsan --strip never
build:ubsan --action_env UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1

build:ci --keep_going

# Generic remote cache
build:ci --remote_download_toplevel
build:ci --remote_timeout=3600
build:ci --remote_upload_local_results

# Generic remote build execution
build:rbe --host_platform=//platforms:x86_64_linux_remote
build:rbe --extra_execution_platforms=//platforms:x86_64_linux_remote
build:rbe --cpu k8
build:rbe --crosstool_top=@gcc_toolchain_x86_64//:_cc_toolchain
build:rbe --strategy=remote
build:rbe --genrule_strategy=remote
build:rbe --spawn_strategy=remote
build:rbe --jobs=32

# BuildBuddy remote exec
build:rbe --remote_executor=grpcs://remote.buildbuddy.io

try-import %workspace%/.bazelrc.user
26 changes: 0 additions & 26 deletions .github/workflows/.bazelrc.ci

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/configurebb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail

if [ "${BUILDBUDDY_API_KEY:-}" ]; then
touch "$HOME/.bazelrc"
chmod 0600 "$HOME/.bazelrc"
echo "build --bes_backend=grpcs://remote.buildbuddy.io"
echo "build --bes_results_url=https://app.buildbuddy.io/invocation/"
echo "build --remote_cache=grpcs://remote.buildbuddy.io"
echo "build --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" > "$HOME/.bazelrc"
fi
49 changes: 19 additions & 30 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Default

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
types: [labeled]
branches: [main]

# Allows manually triggering this workflow from the Actions tab.
workflow_dispatch:

jobs:
distros:
if: ${{ github.ref == 'refs/heads/main' }} or ${{ github.event.label.name == 'ci-test' }}
strategy:
matrix:
os:
Expand All @@ -22,12 +22,12 @@ jobs:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- name: Test
run: ./.github/workflows/engflow.sh --config engflow //...
run: |
./.github/workflows/configurebb.sh
bazel test --config ci //...
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
compilation_modes:
if: ${{ github.ref == 'refs/heads/main' }} or ${{ github.event.label.name == 'ci-test' }}
strategy:
matrix:
compilation_mode:
Expand All @@ -39,16 +39,12 @@ jobs:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- name: Test
run: |-
./.github/workflows/engflow.sh \
--config engflow \
--compilation_mode ${{ matrix.compilation_mode }} \
//...
run: |
./.github/workflows/configurebb.sh
bazel test --config ci --compilation_mode ${{ matrix.compilation_mode }} //...
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
sanitizers:
if: ${{ github.ref == 'refs/heads/main' }} or ${{ github.event.label.name == 'ci-test' }}
strategy:
matrix:
sanitizer:
Expand All @@ -61,16 +57,13 @@ jobs:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- name: Test ${{ matrix.sanitizer }}
run: |-
./.github/workflows/engflow.sh \
--config engflow \
--config ${{ matrix.sanitizer }} \
//tests/sanitizers:${{ matrix.sanitizer }}_test
run: |
./.github/workflows/configurebb.sh
bazel test --config ci --config ${{ matrix.sanitizer }} //tests/sanitizers:${{ matrix.sanitizer }}_test
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
rbe:
if: ${{ github.ref == 'refs/heads/main' }} or ${{ github.event.label.name == 'ci-test' }}
if: (github.ref == 'refs/heads/main' || contains(github.head_ref, 'rbe'))
strategy:
matrix:
os:
Expand All @@ -81,12 +74,8 @@ jobs:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- name: Test with RBE
run: |-
./.github/workflows/engflow.sh \
--config rbe \
--config engflow \
--config engflow_rbe \
//...
run: |
./.github/workflows/configurebb.sh
bazel test --config ci --config rbe //...
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
29 changes: 0 additions & 29 deletions .github/workflows/engflow.sh

This file was deleted.

0 comments on commit 8c414dc

Please # to comment.