-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optimize build matrix #41
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #41 +/- ##
============================================
+ Coverage 81.76% 87.14% +5.38%
- Complexity 191 334 +143
============================================
Files 1 1
Lines 488 778 +290
============================================
+ Hits 399 678 +279
- Misses 89 100 +11 ☔ View full report in Codecov by Sentry. |
@aik099 the change in tests has revealed a "bug" in the browser name test where the input is not matching the output (chromium -> chrome and edge -> MicrosoftEdge). Not sure how to solve this TBH. :( |
You're getting a double build count (on Here is my setup: Do once:
Do each time:
You can see for yourself by comparing the build in mine & your PRs:
|
I was under the impression that a fork is needed for non-maintainers to contribute. As a maintainer, why should I have a fork? In that case I believe the workflow should be better adjusted.. Isn't it also more convenient for you to work on the main repo directly? |
Push down the browser mapping resolution from the constructor into usage places:
This way developer will get the same browser as he provided at driver construction time, but the mapping (to satisfy WebDriver) would be purely driver internal stuff. |
Out of curiosity, I checked how PHPStan does it. It looks similar to something I saw in the GH docs, wouldn't this make more sense? on:
pull_request:
push:
branches:
- "main" |
Belive me. Having PR branches on the main repo is a bad idea. Even worse these PR branches are forked to the contributors repos as well. |
I use the same approach for all repos regardless of the fact, that have |
I'm not saying no. Let's hear other opinions: @stof , @oleg-andreyev , @mvorisek . |
Thank you for asking me. I am strongly for running CI on all pushes - I very often want to run CI on non-PR branch - like before I submit PR, for experiments, ... |
That sounds like you want to run it manually, right? In that case it would make sense to also keep I'm also curious to know how you handle repositories you have push access to, if you fork them or not. |
I simply fork them, enable CI for that repo and push. I prefer CI on every push instead having to trigger it manually. |
The CI will be triggered manually on the origin repo as @mvorisek , in this scenario you'll also get double builds:
The problem, that was supposed to be solved by restricting What do you recommend? |
I am maintainer of atk4 project and we run such CI configuration for years - https://github.com/atk4/ui/blob/5.2.0/.github/workflows/test-unit.yml#L4-L7. So far the CI is great. We even run CI every 2 hours using cron, so we can easily notice dependencies issues. I found the CI run two times is actually useful, as you can easily notice a) difference of branch vs. rebased branch on PR branch (that's how |
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.
As for the main PR topic we're all good here. Accepting changes.
As for a side topic (whatever to create PRs from branches in a main repo, that results in double builds) we can create another issue.
I personally suggest creating PRs from repo fork branches.
Fixes #40.
GitHub workflows have some limitations on setting up "constants" or "global variables".
There are two solutions:
${{ matrix.browser == 'default' && env.DEFAULT_BROWSER || matrix.browser }}
See run: https://github.com/minkphp/webdriver-classic-driver/actions/runs/11645388813
On the whole this seems to work better and is less verbose. The extra step might be confusing and initially, it will not properly list all steps until that first one is executed.
See run: https://github.com/minkphp/webdriver-classic-driver/actions/runs/11645451262