To avoid duplication, I factored out the bazel caching step into a separate action. PiperOrigin-RevId: 504906052pull/13171/head
parent
72e8d59255
commit
5cb1b41a80
3 changed files with 33 additions and 19 deletions
@ -0,0 +1,21 @@ |
||||
name: "Setup Bazel Caching" |
||||
description: "Sets up Bazel caching" |
||||
inputs: |
||||
cache_url: |
||||
description: "URL of the Bazel cache to read/write" |
||||
required: false |
||||
default: https://storage.googleapis.com/protobuf-bazel-cache/upb |
||||
read_only: |
||||
description: "If true, we can read from the cache but not write it." |
||||
required: false |
||||
default: ${{ github.event.pull_request.head.repo.full_name != 'protocolbuffers/upb' }} |
||||
outputs: |
||||
cache_args: |
||||
description: "Caching related arguments to pass to 'bazel build" |
||||
value: --remote_cache=${{ inputs.cache_url }} ${{ steps.set_auth_arg.outputs.auth_arg }} |
||||
runs: |
||||
using: "composite" |
||||
steps: |
||||
- id: set_auth_arg |
||||
run: echo auth_arg=${{ inputs.read_only == 'true' && '--remote_upload_local_results=false' || '--google_default_credentials' }} >> $GITHUB_OUTPUT |
||||
shell: bash |
Loading…
Reference in new issue