-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Parallelize GitHub Action jobs in CI #5458
Parallelize GitHub Action jobs in CI #5458
Conversation
@pkuczynski what do you think about this change? |
8f388da
to
fe1e25c
Compare
It make sense to run things in parallel if it speeds up the tests, that's for sure. Just the code duplication is aweful. Can we somehow avoid this? @eregon wdyt? |
What about using a 2-dimensional matrix for that? That should address the duplication and keep things concise. |
Only on macOS which is a PITA. They work fine on Linux AFAIK. |
fe1e25c
to
55be111
Compare
I don't like these duplications either. Unfortunately, every job must perform similar activities:
At the moment I have no idea how to do it better, although I would love to share these parts of the job.
If you mean strategies (matrix for OS), it won't change anything. To introduce parallelism, we need separate jobs. Anyway, where we run jobs on different OSs, I used matrix. I only removed where it was conditional. |
Some general feedback: I think 9min vs 14min doesn't make a huge difference, in either case no one will wait for that actively. And then of course it will redo some work multiple times which is rather wasteful (e.g. compile ruby 2.7.7). |
Use a matrix e.g. like here: https://github.com/ruby/spec/blob/1afa2eab1cab5df6c5706fc5b7e92756b1db4f07/.github/workflows/ci.yml#L10-L12 (the keys would be You can even avoid those |
9a9427d
to
55be111
Compare
Yes, separation is a big advantage. If we add caching in the future, we should gain more time. |
Interesting idea. I'll see what I can do with it. |
a535be9
to
286e714
Compare
@pkuczynski @eregon I made changes and it looks better. What do you think? |
286e714
to
c1b8a2b
Compare
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.
Looks great now, 2 more comments
9adcabd
to
430c00b
Compare
CI tests take a long time because they run different cases one after the other. If something fails, no further tests will be run. In brief it parallelized GitHub Action jobs in CI and use 2-dimensional matrix for strategy, becase we don't want duplication.
430c00b
to
bf3b37c
Compare
@pkuczynski Could you merge? (I cannot) |
@pkuczynski Since we have changed the CI process, we also need to change the settings in -> Settings -> Branches -> Branch protection rules. Then select Edit for the "master" branch. And then in the "Require status checks to pass before merging" option, remove the status checks "tests" and add "CI/tests". |
Sure I can :) Give me few mins. |
MacOS tests are taking ridicilous long. Maybe we could check why... |
Thank you @torrocus for your contribution |
Looking at https://github.com/rvm/rvm/actions/runs/8945080363/usage and specific logs for test/fast/*, it looks like on Linux it's mostly (only?) prebuilt Ruby binaries being used, while on macOS every ruby installed seems compiled from source, which takes a while. One thing to improve might be to always use the same Ruby version for all tests and avoid uninstalling it. |
That make sense. We had issues with building movable ruby in the past for macOS :( |
Pull Request Summary
CI tests take a long time because they run different cases one after the other. If something fails, no further tests will be run.
CI tests have not been passed for some time now. Fast tests didn't pass on CI for MacOS. This change is intended to help us solve this problem more easily.Changes proposed in this pull request:
Feedback
The total CI execution time is the same, but the waiting time for the test results is shorter.
Before
After