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

Convert to GitHub Actions #112

Merged
merged 1 commit into from
Jul 7, 2022
Merged

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Jul 5, 2022

Tests ran @ https://github.com/ekohl/gem2rpm/runs/7203637950?check_suite_focus=true but they won't run as CI until this is merged.

with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake
Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Member

@voxik voxik Jul 6, 2022

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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!

@ekohl ekohl force-pushed the convert-to-gha branch 2 times, most recently from d42b1db to 6a96dbc Compare July 7, 2022 09:21
@ekohl ekohl force-pushed the convert-to-gha branch from 6a96dbc to ab05a4b Compare July 7, 2022 09:23
@voxik voxik merged commit 0101789 into fedora-ruby:master Jul 7, 2022
@voxik
Copy link
Member

voxik commented Jul 7, 2022

Merged. Thx for the PR. It should help with the others 🎉

@ekohl ekohl deleted the convert-to-gha branch July 7, 2022 18:34
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.

3 participants