name: CI
on: push

jobs:
  build:
    name: "Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}: Tests"
    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.5', '2.6', '2.7']
        rails: ['5.0', '5.1', '5.2', '6.0', '6.1', '7.0']
        exclude:
          - {ruby: '2.5', rails: '7.0'}
          - {ruby: '2.6', rails: '7.0'}
    env:
      BUNDLE_GEMFILE: gemfiles/rails${{ matrix.rails }}.gemfile
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - uses: zendesk/checkout@v2
      - uses: zendesk/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - run: bundle exec rake test

name: CI
on: push

jobs:
  build:
    name: "Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}: Tests"
    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
        rails: ['5.0', '5.1', '5.2', '6.0', '6.1', '7.0']
        exclude:
          - {ruby: '2.5', rails: '7.0'}
          - {ruby: '2.6', rails: '7.0'}
          - {ruby: '3.0', rails: '5.0'}
          - {ruby: '3.0', rails: '5.1'}
          - {ruby: '3.0', rails: '5.2'}
          - {ruby: '3.1', rails: '5.0'}
          - {ruby: '3.1', rails: '5.1'}
          - {ruby: '3.1', rails: '5.2'}
    env:
      BUNDLE_GEMFILE: gemfiles/rails${{ matrix.rails }}.gemfile
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - uses: zendesk/checkout@v2
      - uses: zendesk/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - run: bundle exec rake test

Test with Ruby 3.0 and 3.1
Test with Ruby 3.0 and 3.1
