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

Replace Travis CI with GitHub Actions #266

Merged
merged 85 commits into from
Jan 8, 2020
Merged

Replace Travis CI with GitHub Actions #266

merged 85 commits into from
Jan 8, 2020

Conversation

pkuczynski
Copy link
Member

@pkuczynski pkuczynski commented Jan 4, 2020

GitHub Actions is much faster and responsive than Travis

@pkuczynski pkuczynski added this to the 2.2.0 milestone Jan 4, 2020
@pkuczynski pkuczynski self-assigned this Jan 4, 2020
@pkuczynski pkuczynski changed the title Migrate CI to GitHub Actions Replace Travis CI with GitHub Actions Jan 4, 2020
@pkuczynski
Copy link
Member Author

After many fail and error I finally was able to implement caching (it's quite compliacted due using appraisal and testing against extensive ruby/rails matrix), but that didn't helped much:

Before:

* 2.4: 4m 12s
* 2.5: 3m 22s
* 2.6: 3m 25s
* 2.7: 3m 50s
* truffleruby: 42m 30s

After:

* 2.4: 2m 14s
* 2.5: 2m 32s
* 2.6: 2m 11s
* 2.7: 2m 20s
* truffleruby: 34m 41s

I am not sure why after restoring the cache it does not pick up all installed gems, but only some and still needs to install some others. It does not happen on my local machine... You can observe thus behavior here: https://github.com/railsconfig/config/runs/379685645

@pkuczynski pkuczynski merged commit baaae44 into master Jan 8, 2020
@pkuczynski pkuczynski deleted the github-actions branch January 8, 2020 16:38
@eregon
Copy link

eregon commented Jan 8, 2020

@pkuczynski I would guess the reason is the Bundler vendor path is not picked for bundle exec appraisal install. I think setting BUNDLE_PATH globally for the whole job might help.

@pkuczynski
Copy link
Member Author

Shouldn't bundle config path solve it? That's the recommendation from actions/cache documentation...

I also added JRuby to the test matrix #228 (much easier doable than in Travis). It took only 6m to run the pipeline (2x slower than mri ruby). Check it out in https://github.com/rubyconfig/config/runs/379884681. In this light >30m for truffleruby is really sad :(

@eregon
Copy link

eregon commented Jan 10, 2020

Shouldn't bundle config path solve it? That's the recommendation from actions/cache documentation...

You're right, that should be fine since that's global and saved in ~/.bundle/config.

The issue is then the path is relative to where bundle install is run.
I wonder if it would work with an absolute path like bundle config path $HOME/.bundler_cache.
Then it might help to cache not just one Gemfile but all of them.

@pkuczynski
Copy link
Member Author

I am now setting BUNDLE_PATH and that helps a lot with reusing dependencies:

https://github.com/rubyconfig/config/pull/228/files#diff-353995fb5bebaef307ec25fa5be39042R17

Now truffleruby is 10m instead of 45m :) Still way slower then mri (45-70s)

@pkuczynski
Copy link
Member Author

Btw. jruby is lesst then 5m

You can see all results here https://github.com/rubyconfig/config/pull/228/checks?check_run_id=384222383

@pkuczynski
Copy link
Member Author

For comparison on travis testing only sinatra was taking about 15m. I could never get rails examples working with truffleruby, but now I am testing all apps in a single test run, which seems to be way more efficient than spinning multiple builds.

For comparison: https://travis-ci.org/railsconfig/config/builds/634314479

@eregon
Copy link

eregon commented Jan 10, 2020

@pkuczynski Very happy to hear you found a way to cache Bundler properly :)

It's expected more optimizing implementations are slower to run tests/specs, because tests/specs typically do everything but only a few times, nothing in a loop and nothing to really optimize. More optimizing implementations profile the execution, which has some cost in interpreter.
TruffleRuby doesn't optimize for interpreter performance but for performance after JIT compilation. Trade-offs essentially.

I'm sure we can always improve, but those times don't seem unreasonable to me.
Bundler performance is much slower than it should though as I said earlier, we're investigating that.

@pkuczynski
Copy link
Member Author

Sure thing! Thanks for the explanation. I just wanted to follow up with feedback and observations :) Now when the cashing works, build seems more reasonable :)

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

Successfully merging this pull request may close these issues.

2 participants