This will allow them to reuse our bazelrc and remote caching setup. This also silences the non-bzlmod windows test that's hitting the windows path length. PiperOrigin-RevId: 626390416pull/16687/head
parent
58aab31930
commit
1ee203b045
14 changed files with 172 additions and 123 deletions
@ -1,23 +1,56 @@ |
||||
name: Bazel |
||||
name: Bazel Tests |
||||
|
||||
# Controls when the action will run. |
||||
on: |
||||
# Triggers the workflow on push or pull request events but only for the main branch |
||||
push: |
||||
branches: [main] |
||||
pull_request: |
||||
branches: [main] |
||||
# Allows you to run this workflow manually from the Actions tab |
||||
workflow_dispatch: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
concurrency: |
||||
# Cancel previous actions from the same PR or branch except 'main' branch. |
||||
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info. |
||||
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}} |
||||
cancel-in-progress: ${{ github.ref_name != 'main' }} |
||||
permissions: |
||||
contents: read |
||||
|
||||
jobs: |
||||
test: |
||||
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v6 |
||||
with: |
||||
folders: '["examples"]' |
||||
examples: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
runner: [ ubuntu, windows, macos ] |
||||
bazelversion: [ '7.1.1' ] |
||||
bzlmod: [true, false ] |
||||
include: |
||||
- runner: ubuntu |
||||
bazelversion: '6.4.0' |
||||
bzlmod: true |
||||
- runner: ubuntu |
||||
bazelversion: '6.4.0' |
||||
bzlmod: false |
||||
runs-on: ${{ matrix.runner }}-latest |
||||
name: Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }} |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: protocolbuffers/protobuf-ci/checkout@v3 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Windows startup flags |
||||
if: runner.os == 'Windows' |
||||
working-directory: examples |
||||
shell: bash |
||||
run: echo "startup --output_user_root=C:/ --windows_enable_symlinks" >> .bazelrc |
||||
|
||||
- name: Configure Bazel version |
||||
working-directory: examples |
||||
shell: bash |
||||
run: echo "${{ matrix.bazelversion }}" > .bazelversion |
||||
|
||||
- name: Run tests |
||||
uses: protocolbuffers/protobuf-ci/bazel@v3 |
||||
# TODO Silence this until we have a fix. |
||||
if: runner.os != 'Windows' || matrix.bzlmod |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: examples |
||||
version: ${{ matrix.bazelversion }} |
||||
bash: cd examples && bazel build //... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} |
||||
|
@ -1 +1,9 @@ |
||||
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 |
||||
common --enable_platform_specific_config |
||||
|
||||
build:linux --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 |
||||
build:macos --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 |
||||
|
||||
common:windows --enable_runfiles |
||||
|
||||
build --experimental_remote_cache_eviction_retries=5 |
||||
build --remote_download_outputs=all |
||||
|
Loading…
Reference in new issue