GH Actions: switch over to parallel linting of PHP files #653
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Composer
This installs two additional PHP packages in
require-dev
:php-parallel-lint
which allows for linting PHP files in parallel (faster), as well as automatically recursively walking directories.php-console-highlighter
which provides PHP code highlighting in the command line console, allowing the linter to display the results in a more meaningful manner.It also adjusts the existing
bin/php-lint
script to use this new dependency instead of using *nix specific commands.GH Actions
As it was, PHP linting was only done on PHP 7.4 as part of the
basics
workflow.This commit changes this to run linting on the lowest (PHP 5.4) and highest (latest/PHP 8.0) supported PHP versions as part of the
test
workflow. (And by "supported", I mean runtime support in this case, not syntax support.)The running of the tests has been made dependent on the linting jobs passing as if the linting turns up failures, we can be sure that there will be (or should be) failures in the test runs anyway.
This new job uses the "CS2PR" tool which will show any errors as feedback in the actual PR code view.
It also runs the linter against PHP 8.1 - against which we are currently not yet running the tests - as an early warning system in case of upcoming issues.
Ref:
Related to #628