Skip to content

Commit

Permalink
add job to run on buildbuddy cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbreen committed Sep 16, 2023
1 parent be454b1 commit da7bd5e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 31 deletions.
23 changes: 15 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ common --ui_actions_shown 64
build --incompatible_strict_action_env
build --show_result=20
build --verbose_failures
build --incompatible_enable_cc_toolchain_resolution
build --experimental_platforms_api
test --test_output=errors
test:ci --test_output=all

build:docker --experimental_docker_verbose
build:docker --experimental_enable_docker_sandbox
build:docker --experimental_docker_use_customized_images # If enabled we'll need to customise the images ourselves
build:docker --experimental_docker_use_customized_images
build:docker --strategy=CppCompile=docker --strategy=CppLink=docker --strategy=CcStrip=docker --strategy=MakeRpm=docker
build:docker --experimental_docker_privileged # For SELinux

#build:remote --strategy=CppCompile=remote --strategy=CppLink=remote --strategy=CcStrip=remote --strategy=MakeRpm=remote
test:remote --strategy=remote
build:docker --experimental_docker_privileged

build:remote --bes_results_url=http://localhost:8080/invocation/
build:remote --bes_backend=grpc://localhost:1985
Expand All @@ -23,6 +23,13 @@ build:remote --remote_timeout=120
build:remote --remote_executor=grpc://localhost:1985
build:remote --remote_header=x-buildbuddy-api-key=M3LUl7prhCCaqVCUAb18

build --incompatible_enable_cc_toolchain_resolution
build --experimental_platforms_api

build:bb --build_metadata=ROLE=CI
build:bb --bes_results_url=https://app.buildbuddy.io/invocation/
build:bb --bes_backend=grpcs://remote.buildbuddy.io
build:bb --remote_cache=grpcs://remote.buildbuddy.io
build:bb --remote_executor=grpcs://remote.buildbuddy.io
build:bb --remote_upload_local_results
#build:bb --host_platform=@buildbuddy_toolchain//:platform
#build:bb --platforms=@buildbuddy_toolchain//:platform
#build:bb --crosstool_top=@buildbuddy_toolchain//:toolchain
build:bb --jobs=100
73 changes: 50 additions & 23 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,57 @@ jobs:
*.cache-to=type=gha,mode=max
bazel:
name: Bazel Build & Test
name: Bazel Build & Test w/Docker
runs-on: ubuntu-latest
needs:
- executors
steps:
- name: Bazel Home RC
run: |
echo "build --disk_cache=~/.cache/bazel.disk" >> ~/.bazelrc
echo "test --test_output=all" >> ~/.bazelrc
- uses: actions/cache@v3
with:
path: ${{github.workspace}}/.cache/bazel.disk
key: bazel
- uses: actions/checkout@v3
- name: Bazel Build with Docker
run: sudo runuser -u runner -g runner -G docker -- bazel build --config docker hellos tars rpms debs
- name: Bazel Host Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=sandboxed host-{hellos,tars}-test # We won't test the RPM and DEB tests on the host as they actually install the package.
- name: Bazel Docker Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=docker platform-{hello,tar,rpm,deb}-test-suite
- name: Work around https://github.com/actions/upload-artifact/issues/92
run: echo "bazel_out=$(sudo runuser -u runner -g runner -G docker -- bazel info output_path)" >> $GITHUB_ENV
- run: sudo runuser -u runner -g runner -G docker -- bazel shutdown
- uses: actions/upload-artifact@v3
with:
name: test-results
path: ${{env.bazel_out}}/*/testlogs/**
- name: Bazel Home RC
run: |
echo "build --config=ci" >> ~/.bazelrc
echo "build --disk_cache=~/.cache/bazel.disk" >> ~/.bazelrc
- uses: actions/cache@v3
with:
path: ${{github.workspace}}/.cache/bazel.disk
key: bazel
- uses: actions/checkout@v3
- name: Work around https://github.com/actions/upload-artifact/issues/92
run: echo "bazel_out=$(sudo runuser -u runner -g runner -G docker -- bazel info output_path)" >> $GITHUB_ENV
- name: Bazel Build
run: sudo runuser -u runner -g runner -G docker -- bazel build --config docker hellos tars rpms debs
- name: Bazel Host Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=sandboxed host-{hellos,tars}-test # We won't test the RPM and DEB tests on the host as they actually install the package.
- uses: actions/upload-artifact@v3
with:
name: host-test-results
path: ${{env.bazel_out}}/*/testlogs/**
- name: Bazel Remote Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=docker platform-{hello,tar,rpm,deb}-test-suite
- uses: actions/upload-artifact@v3
with:
name: docker-test-results
path: ${{env.bazel_out}}/*/testlogs/**
- run: sudo runuser -u runner -g runner -G docker -- bazel shutdown

buildbuddy:
name: Bazel Build & Test w/BuildBuddy
runs-on: ubuntu-latest
needs:
- executors
steps:
- name: Bazel Home RC
run: |
echo "build --config=ci" >> ~/.bazelrc
echo "build:bb --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }}" >> ~/.bazelrc
- uses: actions/checkout@v3
- name: Work around https://github.com/actions/upload-artifact/issues/92
run: echo "bazel_out=$(bazel info output_path)" >> $GITHUB_ENV
- name: Bazel Build with BuildBuddy
run: bazel build --config bb hellos tars rpms debs
- name: Bazel Test
run: bazel test --config bb platform-{hello,tar,rpm,deb}-test-suite
- uses: actions/upload-artifact@v3
with:
name: buildbuddy-test-results
path: ${{env.bazel_out}}/*/testlogs/**
- run: bazel shutdown

0 comments on commit da7bd5e

Please sign in to comment.