name: Ruby
on: [push,pull_request]
jobs:
  spec:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby: [ '2.6', '2.7' ]
        rails: [ '5.0', '5.1', '5.2', '6.0', '6.1' ]
        continue-on-error: [false]
        include:
          - ruby: '3.0'
            rails: '5.2'
            continue-on-error: true # XXX: Temporary
          - ruby: '3.0'
            rails: '6.0'
            continue-on-error: false
          - ruby: '3.0'
            rails: '6.1'
            continue-on-error: false
    continue-on-error: ${{ matrix.continue-on-error }}
    services:
      mysql:
        image: mysql:5.7
        ports: ["3306:3306"]
        env:
          MYSQL_ROOT_USER: root
          MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    name: Test on Ruby ${{ matrix.ruby }} & Rails ${{ matrix.rails }}
    env:
      BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
      DATABASE_URL: mysql2://root@127.0.0.1:3306/garage_dummy_test
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Setup DB
      run: RAILS_ENV=test bundle exec rake db:setup
    - name: Run tests
      run: bundle exec rspec

name: Ruby
on: [push,pull_request]
jobs:
  spec:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby: [ '2.6', '2.7' ]
        rails: [ '5.0', '5.1', '5.2', '6.0', '6.1' ]
        continue-on-error: [false]
        include:
          - ruby: '3.0'
            rails: '6.0'
            continue-on-error: false
          - ruby: '3.0'
            rails: '6.1'
            continue-on-error: false
    continue-on-error: ${{ matrix.continue-on-error }}
    services:
      mysql:
        image: mysql:5.7
        ports: ["3306:3306"]
        env:
          MYSQL_ROOT_USER: root
          MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    name: Test on Ruby ${{ matrix.ruby }} & Rails ${{ matrix.rails }}
    env:
      BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
      DATABASE_URL: mysql2://root@127.0.0.1:3306/garage_dummy_test
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Setup DB
      run: RAILS_ENV=test bundle exec rake db:setup
    - name: Run tests
      run: bundle exec rspec

Remove Rails 5.2 x Ruby 3.0 test from CI
Remove Rails 5.2 x Ruby 3.0 test from CI

Because Rails 5.2 doesn't support Ruby 3.0.
