agents:
  queue: hosted

steps:
  - label: ":rspec: Tests :ruby: {{matrix}}"
    command:
      - "bundle"
      - "bundle exec rake"
    plugins:
      - docker#v3.7.0:
          image: "public.ecr.aws/docker/library/ruby:{{matrix}}"
    matrix:
      - "latest"
      - "3.3"
      - "3.2"
      - "3.1"
      - "3.0"
      - "2.7"

  - group: ":rspec: Legacy Ruby :ruby:"
    steps:
      - label: ":rspec: Tests :ruby: {{matrix}}"
        command:
          - "gem install bundler:2.3.25"
          - "bundle"
          - "bundle exec rake"
        plugins:
          - docker#v3.7.0:
              # Images for older Ruby versions aren't available on AWS ECR
              # so fall back to Docker Hub
              image: "ruby:{{matrix}}"
        matrix:
          - "2.6"
          - "2.5"
          - "2.4"
          - "2.3"