Determine available CPUs on Kubernetes
Fixes phpstan/phpstan#7479
@ondrejmirtes why I get
Method
PHPStan\Process\CpuCoreCounter::getNumberOfCpuCores()throws checked exceptionDivisionByZeroErrorbut it's missing from the PHPDoc@throwstag.
when playground does not return any error for this code? 🤔
@Wirone Because this is reported only as part of some optional rules: https://phpstan.org/blog/bring-your-exceptions-under-control
I set this exception to be unchecked and rebased the branch. There are some memory limit errors which is weird, I need to look into it.
@ondrejmirtes do you have any idea what's wrong with the memory limits? 🤔 I think it's not caused by my changes, so how we can fix that and finish this PR?
My wild guess is that GitHub Actions also runs on Kubernetes. We'd have to debug the number of cores used before and after your changes to see if it can be the reason for exhausting memory limit.
Hi, I'm cleaning up old and stale PRs. Please send a new PR if you're still interested, thanks.