BrainMonkey icon indicating copy to clipboard operation
BrainMonkey copied to clipboard

GH Actions: make workflow more modular

Open jrfnl opened this issue 1 month ago • 0 comments

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:

  1. Always running against the latest stable PHP version.
  2. No longer being subject to the error_reporting=-1, which could lead to PHP deprecation notices for PHPCS/PHPCompatibility breaking the scan.
  3. 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 cs2pr to provide inline annotations with feedback in PRs.
  4. 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:

  1. Only running against the high/low of each PHP major + PHP nightly. That should be enough to caught all parse/compile errors.
  2. Also linting the inc subdirectory, which was previously skipped/missed.
  3. 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.
  4. Setting the report format to "checkstyle" and letting the cs2pr tool provide inline annotations about parse/compile errors found in PRs.
  5. Making the test job dependent on the lint job, as we already know it will fail if the lint job fails, so let's not waste any resources starting up the test builds.

jrfnl avatar Dec 02 '25 16:12 jrfnl