name: CI

on: push

jobs:
  specs:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        ruby-version:
          - 2.6
        gemfile:
          - rails5.0
          - rails5.1
          - rails5.2
          - rails6.0
          - rails6.1
    env:
      BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
    steps:
      - uses: zendesk/checkout@v2
      - name: Set up Ruby
        uses: zendesk/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby-version }}
          bundler-cache: true
      - name: RSpec
        run: bundle exec rspec

  specs_successful:
    name: Specs passing?
    needs: specs
    if: always()
    runs-on: ubuntu-latest
    steps:
      - run: |
          if ${{ needs.specs.result == 'success' }}
          then
            echo "All specs pass"
          else
            echo "Some specs failed"
            false
          fi

name: CI

on: push

jobs:
  specs:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        ruby-version:
          - '2.6'
          - '2.7'
          - '3.0'
          - '3.1'
        gemfile:
          - rails5.0
          - rails5.1
          - rails5.2
          - rails6.0
          - rails6.1
        exclude:
          - {ruby-version: '3.0', gemfile: rails5.0}
          - {ruby-version: '3.0', gemfile: rails5.1}
          - {ruby-version: '3.0', gemfile: rails5.2}
          - {ruby-version: '3.0', gemfile: rails6.0}
          - {ruby-version: '3.1', gemfile: rails5.0}
          - {ruby-version: '3.1', gemfile: rails5.1}
          - {ruby-version: '3.1', gemfile: rails5.2}
          - {ruby-version: '3.1', gemfile: rails6.0}
    env:
      BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
    steps:
      - uses: zendesk/checkout@v2
      - name: Set up Ruby
        uses: zendesk/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby-version }}
          bundler-cache: true
      - name: RSpec
        run: bundle exec rspec

  specs_successful:
    name: Specs passing?
    needs: specs
    if: always()
    runs-on: ubuntu-latest
    steps:
      - run: |
          if ${{ needs.specs.result == 'success' }}
          then
            echo "All specs pass"
          else
            echo "Some specs failed"
            false
          fi

Test with Ruby 2.7, 3.0, & 3.1
Test with Ruby 2.7, 3.0, & 3.1

Only tests 3.0 & 3.1 with Rails 6.1
