name: CI - RBE

on:
  pull_request:
    paths-ignore:
      - 'docs/decisions/**'
  push:
    branches:
      - trunk
  workflow_dispatch:
    inputs:
      disable_test_cache:
        description: 'Force re-run of tests (disable test cache)'
        required: false
        default: false
        type: boolean
  workflow_call:

concurrency:
  group: ci-rbe-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read
  packages: read

jobs:
  test:
    name: Test
    if: github.event.repository.fork == false
    uses: ./.github/workflows/bazel.yml
    with:
      name: All RBE tests
      cache-save: ${{ github.ref_name == 'trunk' }}
      rerun-with-debug: true
      ruby-version: jruby-10.1.0.0
      run: ./scripts/github-actions/ci-build.sh ${{ github.event.inputs.disable_test_cache }}
