---
name: test
on: push
jobs:
  rspec:
    name: "Ruby ${{ matrix.ruby }}"
    runs-on: ubuntu-20.04

    strategy:
      fail-fast: false
      matrix:
        ruby:
          - "3.0"
          - "2.7"
          - "2.6"
          - "2.5"

    steps:
      - uses: actions/checkout@master
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: True
        env:
          BUNDLE_WITHOUT: development
          BUNDLE_JOBS: 4
          BUNDLE_RETRY: 3

      - run: bundle exec rspec --color

  rubocop:
    name: rubocop
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@master
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.0
          bundler-cache: True
        env:
          BUNDLE_WITHOUT: development
          BUNDLE_JOBS: 4
          BUNDLE_RETRY: 3

      - run: bundle exec rubocop --parallel --fail-level E
