GH Actions: make workflow more modular
GH Actions: move PHPCompatibility check to separate job
As things were, the PHP 7.4 build could unexpectedly fail on a PHPCompatibility issue. This violates the principle of least surprise for contributors.
This commit removes the step which runs PHPCompatibility from the qa workflow and sets up a separate job to run PHPCompatibility.
In addition to this, it improves how the PHPCompatibility task is run by:
- Always running against the
lateststable PHP version. - No longer being subject to the
error_reporting=-1, which could lead to PHP deprecation notices for PHPCS/PHPCompatibility breaking the scan. - Telling PHPCS to create both a "full" as well as a checkstyle report.
The "full" report will be displayed in the GHA logs.
The "checkstyle" report will be used by
cs2prto provide inline annotations with feedback in PRs. - Turns on parallel running, which should make the task fast to run.
GH Actions: move PHP linting to separate job
Generally speaking, if a project has high test coverage and the tests are being run in CI, the loading of the files for running the tests will uncover parse/compile errors and fail the build.
However, the messages about this coming from PHPUnit may not be as clear-cut. Additionally, there may be a situation (now or later) where there are some select PHP files in the project which aren't run in the test job, so having a "lint" job is still a good idea.
This commit removes the step which runs PHP Parallel Lint from the qa workflow and sets up a separate job to run PHP Parallel Lint.
In addition to this, it improves how the PHP Parallel Lint task is run by:
- Only running against the high/low of each PHP major + PHP nightly. That should be enough to caught all parse/compile errors.
- Also linting the
incsubdirectory, which was previously skipped/missed. - PHP can show a limited number of deprecation messages during linting. By default this ability is turned off. This ability has now been explicitly turned on.
- Setting the report format to "checkstyle" and letting the
cs2prtool provide inline annotations about parse/compile errors found in PRs. - Making the
testjob dependent on thelintjob, as we already know it will fail if thelintjob fails, so let's not waste any resources starting up the test builds.