-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 626390416
- Loading branch information
1 parent
58aab31
commit 1ee203b
Showing
14 changed files
with
172 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.