-
Notifications
You must be signed in to change notification settings - Fork 45
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
Convert to GitHub Actions #112
Conversation
.github/workflows/ci.yml
Outdated
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- run: bundle exec rake |
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.
Is there a reason to use Bundler 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.
Mostly because it's what I'm used to. Another benefit is that the GitHub action creates a cache for the next CI run. It integrates nicely with the Gemfile
. Note I had to add rake
there since it wasn't present in Ruby >= 2.3 (IIRC, could be 2.4).
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.
I think that Bundler was always used for installation, but never for execution. Using Bundler has possibly some side effects and I'd like to avoid it.
Also, as far as I can tell, Rake was first included as a bundled gem in Ruby 2.3 [1], but prior that, it was part of StdLib. Therefore I think that if Bundler is not used for execution, we should be fine without it being specified in Gemfile (and these are the side effect of Bundler and why I don't think Bundler should be used for test suite execution).
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.
https://github.com/ekohl/gem2rpm/actions/runs/2628516915 is the new run. I wonder why Ruby 2.6 failed.
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.
Ok, I guess it was just an odd issue because when I reran it it passed: https://github.com/ekohl/gem2rpm/actions/runs/2628526691
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true |
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.
You'd have to use the github cache action as well for persisting the cache across runs, right?
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.
This is all built into the ruby/setup-ruby action. See https://github.com/ruby/setup-ruby#caching-bundle-install-automatically for the details.
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.
Ah, TIL! Thanks for the info @ekohl!
d42b1db
to
6a96dbc
Compare
Merged. Thx for the PR. It should help with the others 🎉 |
Tests ran @ https://github.com/ekohl/gem2rpm/runs/7203637950?check_suite_focus=true but they won't run as CI until this is merged.