free-programming-books
free-programming-books copied to clipboard
ci(check-urls): use a matrix to speed-up execution
What does this PR do?
Improve repo
For resources
Description
The matrix strategy creates 10 max-parallel workers with a disabled fail-fast parameter
Examples
- Before: https://github.com/davorpa/free-programming-books/actions/runs/2999590952
- After: https://github.com/davorpa/free-programming-books/actions/runs/3007199364
Running the workflow when -langs.md or -subject.md files are involved could exhaust the runner execution max-time like sometime happens in the past (https://github.com/EbookFoundation/free-programming-books/actions/runs/2924594027 max is 360min).

Using this implementation... the elapsed time is of the longest execution time, normally no more than 30min on the worst of cases.
Moreover, we can meter how much time awesome bot consumes in each check.
Checklist:
- [x] Read our contributing guidelines.
- [x] Used an informative name for this pull request.
Follow-up
- Check the status of GitHub Actions and resolve any reported warnings!
there must be some limit on how many threads the repo can use as a whole. Worrying about load in October
there must be some limit on how many threads the repo can use as a whole. Worrying about load in October
About max-parallel matrix strategy param:
The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines
Is it 10 well or better leave GitHub to decide?
Moreover... setting max-parallel: 1 it will the same what we have now :wink: but with a bit penalization of 5s (I'm not sure at all) wasting on warm up the job container.
Investigating if needs / how to add
https://github.com/davorpa/free-programming-books/blob/f9be34faa39faafe64bfb2c5c4b118bbfa8761c9/.github/workflows/check-urls.yml#L59-L67
a precheck when no files are changed. It could crash if spawned jobs are 0. It could be related with #7059 but addressing concurrency
Investigating if needs / how to add
davorpa/free-programming-books@
f9be34f/.github/workflows/check-urls.yml#L59-L67a precheck when no files are changed. It could crash if spawned jobs are 0. It could be related with #7059 but addressing concurrency
Fixed!!!
The workflows runs testing that:
- Failing: https://github.com/davorpa/free-programming-books/actions/runs/3031689939
- Working after apply 3e9a1e69778e91da5ceec71e649dba4be5bd194a: https://github.com/davorpa/free-programming-books/actions/runs/3031721462
Reviewers welcome!
Conflicts are with #7096. Preserve it side in concurrency config
Oh no 😟! Conflicts have been found.
Please 🙏, take a moment and address the merge conflicts of your pull request before we can evaluate it again.
Thanks in advance for your effort and patience ❤️!
This seems like it could be a really nice improvement. I like that you are not failing fast so a user can see all issues right away. In looking at the workflow results I am a bit confused though.
Original Workflow

Matrix workflow

As you can see, the new workflow shows a total time that is nearly 3 times as long as the original. With that said, the individual times add up to 30s so maybe this is misleading on GitHubs part. Additionally, this is only running a single test, so not really seeing the full benefits of the matrix.
As far as I can tell, this is, at the very least, working as expected. Would it be worth making some test PR's that trigger as many workflows as possible to get a better gauge what improvement to execution time this makes? Admittedly, I have not used this matrix feature before, so let me know if there is anything else I should look into/test on my end.
is this ready?
is this ready?
Yes, developing is ready 😉