name: Test

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  build:
    runs-on: ubuntu-latest
    name: Test on Rails ${{ matrix.rails_version }}
    strategy:
      matrix:
        rails_version:
          - ~> 5.1.0
          - ~> 5.2.0
          - ~> 6.0.0
          - ~> 6.1.0
          - ~> 7.0.0
    container: docker://ruby
    steps:
    - uses: actions/checkout@v1
    - name: Build and test
      run: |
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rake
      env:
        RAILS_VERSION:  ${{ matrix.rails_version }}

name: Test

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  build:
    runs-on: ubuntu-latest
    name: Test on Rails ${{ matrix.rails_version }}
    strategy:
      matrix:
        include:
          - rails_version: ~> 7.0.0
            ruby_version: 3.1
          - rails_version: ~> 6.1.0
            ruby_version: '3.0'
          - rails_version: ~> 6.0.0
            ruby_version: 2.7
          - rails_version: ~> 5.2.0
            ruby_version: 2.6
          - rails_version: ~> 5.1.0
            ruby_version: 2.5
    container: docker://ruby:${{ matrix.ruby_version }}
    steps:
    - uses: actions/checkout@v1
    - name: Build and test
      run: |
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rake
      env:
        RAILS_VERSION:  ${{ matrix.rails_version }}

Load an appropriate Ruby version for each Rails version
Load an appropriate Ruby version for each Rails version
