---
name: Test

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

jobs:
  lint:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Ruby 2.7
        uses: actions/setup-ruby@v1
        with:
          ruby-version: 2.7.x
      - name: Rubocop Linter Action
        uses: andrewmcodes/rubocop-linter-action@v3.1.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  spec:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Ruby 2.7
        uses: actions/setup-ruby@v1
        with:
          ruby-version: 2.7.x
      - name: Build and test with Rake
        run: |
          gem install bundler
          bundle install --jobs 4 --retry 3
          bundle exec rake

---
name: Test

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

jobs:
  lint:
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - '2.7'
          - '3.0'

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Ruby 2.7
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - name: Run Rubocop
        run: bundle exec rake rubocop

  spec:
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - '2.7'
          - '3.0'

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Ruby 2.7
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - name: Build and test with Rake
        run: |
          gem install bundler
          bundle install --jobs 4 --retry 3
          bundle exec rake

Test on Ruby 2.7 & 3.0 w/ Rake
chore: Test on Ruby 2.7 & 3.0 w/ Rake

Use the new Rake task for RuboCop, plus add matrixed builds to ensure
this works on Ruby 2.7 & Ruby 3.0.

Uses the officially supported rubo/setup-ruby Action, instead of the
deprecated actions/setup-ruby.

Drop using the stale andrewmcodes/rubocop-linter-action Action in favor
of our own Rake task.
