diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 281008ef13..3ac81587a6 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -12,8 +12,17 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 - - name: Install RuboCop gems + - name: Cache gems + uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-rubocop- + - name: Install gems run: | - gem install --no-document rubocop rubocop-performance rubocop-rails + bundle config path vendor/bundle + bundle config set without 'default doc job cable storage ujs test db' + bundle install --jobs 4 --retry 3 - name: Run RuboCop - run: rubocop --parallel + run: bundle exec rubocop --parallel diff --git a/Gemfile b/Gemfile index b2d8f1ec05..615a1d959f 100644 --- a/Gemfile +++ b/Gemfile @@ -28,9 +28,11 @@ gem "uglifier", ">= 1.3.0", require: false # Explicitly avoid 1.x that doesn't support Ruby 2.4+ gem "json", ">= 2.0.0" -gem "rubocop", ">= 0.47", require: false -gem "rubocop-performance", require: false -gem "rubocop-rails", require: false +group :rubocop do + gem "rubocop", ">= 0.47", require: false + gem "rubocop-performance", require: false + gem "rubocop-rails", require: false +end group :doc do gem "sdoc", "~> 1.1"