name: Rubocop
on: [ push, pull_request ]

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CI: true
      TESTOPTS: "-v"
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
          submodules: recursive
      - name: Set up Ruby 3.0
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.0
          bundler-cache: true
      - name: Run RuboCop
        run: bundle exec rubocop --parallel
