steps:
  - label: ":elasticsearch: {{ matrix.stack_version }} :ruby: v{{ matrix.ruby }} :rspec: {{ matrix.suite }}"
    agents:
      provider: "gcp"
    env:
      RUBY_VERSION: "{{ matrix.ruby }}"
      TEST_SUITE: "{{ matrix.suite }}"
      STACK_VERSION: "{{ matrix.stack_version }}"
    matrix:
      setup:
        suite:
          - "free"
          - "platinum"
        ruby:
          - "3.3"
          - "3.2"
          - "3.1"
          - "3.0"
        stack_version:
          - 7.17-SNAPSHOT
      adjustments:
        # Skip platinum for all but Ruby 3.2:
        - with:
            suite: "platinum"
            ruby: "3.1"
          skip: true
        - with:
            suite: "platinum"
            ruby: "3.0"
          skip: true
        # Compatibility tests for 8.x:
        - with:
            stack_version: "8.14.0-SNAPSHOT"
            suite: "free"
            ruby: "3.3"
        - with:
            stack_version: "8.14.0-SNAPSHOT"
            suite: "platinum"
            ruby: "3.3"
    command: ./.buildkite/run-tests.sh
    artifact_paths: "elasticsearch-api/tmp/*"
  - wait: ~
    continue_on_failure: true
  - label: "Log Results"
    command: ./.buildkite/log-results.sh
