---
name: CI

on:
  - push
  - pull_request

jobs:
  rspec:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - '3.0'
          - '2.7'
          - '2.6'
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Setup Ruby cache
        uses: actions/cache@v2
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-${{ matrix.ruby }}-

      - name: Bundle
        run: |
          gem install bundler
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3

      - name: RSpec
        run: |
          ./bin/rake

---
name: CI

on:
  - push
  - pull_request

jobs:
  rspec:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - '2.7'
          - '3.0'
          - '3.1'

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Setup Ruby cache
        uses: actions/cache@v2
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-${{ matrix.ruby }}-

      - name: Bundle
        run: |
          gem install bundler
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3

      - name: RSpec
        run: |
          ./bin/rake

Test on Ruby 3.1 too
Test on Ruby 3.1 too
