Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.1 KiB

name: 'Docker Bazel Run'
description: 'Run a Bazel-based docker image for Protobuf CI testing'
inputs:
credentials:
required: true
description: The GCP credentials to use for reading the docker image
type: string
bazel-cache:
required: true
description: >
A unique path for the Bazel cache. This will trigger the generation
of a BAZEL_CACHE environment variable inside the container that provides
the appropriate flags for any bazel command.
type: string
version:
required: false
description: A pinned Bazel version to use
default: '5.1.1'
type: string
bazel:
required: false
description: The Bazel command to run
type: string
bash:
required: false
description: >
A bash command to run. $BAZEL_FLAGS and $BAZEL_STARTUP_FLAGS will be
available to use for bazel runs.
type: string
runs:
using: 'composite'
steps:
- name: Authenticate
id: auth
uses: ./.github/actions/internal/gcloud-auth
with:
credentials: ${{ inputs.credentials }}
- name: Setup Runner
uses: ./.github/actions/internal/setup-runner
- name: Setup Bazel
id: bazel
uses: ./.github/actions/internal/bazel-setup
with:
credentials-file: ${{ steps.auth.outputs.credentials-file }}
bazel-cache: ${{ inputs.bazel-cache }}
- name: Validate inputs
if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }}
shell: bash
run: echo "Invalid specification of both non-Bazel and Bazel command"; exit 1
- name: Pin Bazel version
shell: bash
run: echo "USE_BAZEL_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
- name: Output Bazel version
shell: bash
run: bazelisk version
- name: Run Bash
if: ${{ inputs.bash }}
run: ${{ inputs.bash }}
shell: bash
- name: Run Bazel
if: ${{ !inputs.bash }}
run: >-
bazelisk ${{ steps.bazel.outputs.bazel-startup-flags }}
${{ inputs.bazel }} ${{ steps.bazel.outputs.bazel-flags }}
shell: bash