name: rubocop on: pull_request: types: [opened, synchronize] push: branches: [ main ] jobs: build: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: setup ruby uses: ruby/setup-ruby@v1 with: ruby-version: '2.5' - name: cache gems uses: actions/cache@v2 with: path: vendor/bundle key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }} restore-keys: ${{ runner.os }}-rubocop- - name: install gems run: | bundle config set path vendor/bundle bundle install --jobs 4 --retry 3 - name: exec rubocop run: bundle exec rubocop --parallel