name: CI - RBE

on:
  pull_request:
  push:
    branches:
      - trunk
  workflow_dispatch:
    inputs:
      disable_test_cache:
        description: 'Force re-run of tests (disable test cache)'
        required: false
        default: false
        type: boolean

jobs:
  format:
    name: Format
    if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
    uses: ./.github/workflows/bazel.yml
    with:
      name: Check format script run
      caching: false
      ruby-version: jruby-10.0.0.0
      run: ./scripts/github-actions/check-format.sh

  test:
    name: Test
    if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
    uses: ./.github/workflows/bazel.yml
    with:
      name: All RBE tests
      caching: false
      ruby-version: jruby-10.0.0.0
      run: ./scripts/github-actions/ci-build.sh ${{ github.event.inputs.disable_test_cache }}
