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

Conversation

eugeneius
Copy link
Member

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.

@kaspth
Copy link
Contributor

kaspth commented Mar 27, 2020

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.
@kaspth
Copy link
Contributor

kaspth commented Mar 27, 2020

Cool, looks like switching the cache key to -rubocop- fixed that.

@eugeneius
Copy link
Member Author

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!

@eugeneius
Copy link
Member Author

Screenshot 2020-03-27 at 23 57 43

🐎

@kaspth
Copy link
Contributor

kaspth commented Mar 27, 2020

lol, looks like it's fairly neck and neck. I say we keep it just in case, but your call.

@eugeneius
Copy link
Member Author

I think it's worth keeping, let's save Ruby Central some bandwidth costs 😄

@eugeneius eugeneius merged commit f085e54 into rails:master Mar 28, 2020
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 😄🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants