-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Conversation
2b2ce4d
to
015d1c3
Compare
Hm, it says our cache size is 500MB: |
Since c1e7268 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.
Cool, looks like switching the cache key to |
015d1c3
to
100f7a7
Compare
That last build ran without a cache, I triggered one more build to see how it works when one exists. Maybe we don't even need a cache! |
lol, looks like it's fairly neck and neck. I say we keep it just in case, but your call. |
I think it's worth keeping, let's save Ruby Central some bandwidth costs 😄 |
run: | | ||
gem install --no-document rubocop rubocop-performance rubocop-rails |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😄🙏
Bundler 2.3.19 can install gems of the specific group now. Refer to https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md#2319-july-27-2022 rubygems/rubygems#5759 rails#38836
Since #38834 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.