Loosen py_proto_library check for paths with hyphens to exclude impor… #916
Workflow file for this run
This file contains hidden or 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
name: Bazel Tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
continuous-run: | ||
required: true | ||
description: "Boolean string denoting whether this run is continuous -- | ||
empty string for presubmit, non-empty string for continuous." | ||
type: string | ||
safe-checkout: | ||
required: true | ||
description: "The SHA key for the commit we want to run over" | ||
type: string | ||
continuous-prefix: | ||
required: true | ||
description: "The string continuous-only tests should be prefixed with when displaying test | ||
results." | ||
type: string | ||
permissions: | ||
contents: read | ||
jobs: | ||
examples: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner: [ ubuntu, windows, macos ] | ||
bazelversion: [ '7.1.2', '8.0.0' ] | ||
bzlmod: [ true, false ] | ||
toolchain_resolution: [ "", "--incompatible_enable_proto_toolchain_resolution=true" ] | ||
runs-on: ${{ matrix.runner }}-latest | ||
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }} ${{ matrix.toolchain_resolution && ' (toolchain resolution)' || '' }} | ||
steps: | ||
- name: Checkout pending changes | ||
if: ${{ !matrix.continuous-only || inputs.continuous-run }} | ||
uses: protocolbuffers/protobuf-ci/checkout@v4 | ||
with: | ||
ref: ${{ inputs.safe-checkout }} | ||
- name: Windows startup flags | ||
if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }} | ||
working-directory: examples | ||
shell: bash | ||
run: echo "startup --output_user_root=C:/ --windows_enable_symlinks" >> .bazelrc | ||
- name: Configure Bazel version | ||
if: ${{ !matrix.continuous-only || inputs.continuous-run }} | ||
working-directory: examples | ||
shell: bash | ||
run: echo "${{ matrix.bazelversion }}" > .bazelversion | ||
- name: Run tests | ||
if: ${{ !matrix.continuous-only || inputs.continuous-run }} | ||
uses: protocolbuffers/protobuf-ci/bazel@v4 | ||
with: | ||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} | ||
bazel-cache: examples-from-protobuf | ||
version: ${{ matrix.bazelversion }} | ||
bash: bazel test @com_google_protobuf-examples//... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }} | ||
- name: Run tests (examples) | ||
if: ${{ !matrix.continuous-only || inputs.continuous-run }} | ||
uses: protocolbuffers/protobuf-ci/bazel@v4 | ||
with: | ||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} | ||
bazel-cache: examples | ||
version: ${{ matrix.bazelversion }} | ||
bash: cd examples && bazel build //... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }} |