Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rubocop group to Gemfile for use in CI #38836

Merged
merged 1 commit into from Mar 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/rubocop.yml
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be easier to specify particular versions in here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache time and gem install is down to a combined 2 seconds. It’s far better that Gemfile.lock is the source of truth. Appreciate the suggestion but I think we’re settled on this 😄🙏

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
8 changes: 5 additions & 3 deletions Gemfile
Expand Up @@ -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"
Expand Down