Since c1e7268c83 we install the latest
version of RuboCop in our GitHub Actions workflow for speed, but this
sacrifices reproducibility; the results will change whenever RuboCop
publishes a new version. Instead we can add a new group to our Gemfile
that just contains the dependencies necessary to run RuboCop, and skip
installing everything else in CI.
Unfortunately it's not possible to tell Bundler to only install gems
from a single group, so we have to tell it not to install every other
group instead.
When pull requests have RuboCop offenses they need to click
"Build and run RuboCop" section and scroll about 200 lines
to skip `bundle install` output.
This change splits "Build and run RuboCop" into two parts.
then "Run RuboCop" section only shows `bundle exec rubocop --parallel`
output
Follows up #37582
GitHub Actions cache requires `path:` parameter to configure
which directory to be cached. It looks there is no easy way to retrieve path information
using bundler command then workaround implemented to use `vendor/bundle`.
Thanks to https://github.com/actions/cache/pull/4
Updated the default Ruby workflow:
* Trigger this action for pull request and push
* Install requried OS packages for Active Record connection adapters
* Removing `gem install bundler` because Ruby 2.6 already installs it
* Run RuboCop in parallel by `bundle exec rubocop --parallel`
* Rename `ruby.yml` to `rubocop.yml` to represent the workflow
Bump RuboCop to 0.76.0 and rename `Style/UnneededPercentQ` to `Style/RedundantPercentQ`
```ruby
$ bundle exec rubocop
Error: The `Style/UnneededPercentQ` cop has been renamed to `Style/RedundantPercentQ`.
(obsolete configuration found in .rubocop.yml
```
Removed `.codeclimate.yml`