|
38 | 38 | # - Runs PHPStan static analysis. |
39 | 39 | # - Reports the results as annotations. |
40 | 40 | # - Uploads the results as an artifact (pull requests only). |
| 41 | + # - Runs the tests of the WordPress-specific PHPStan extensions (default analysis only). |
41 | 42 | # - Checks for errors that cannot be reported as warnings, such as out-of-date baselines. |
42 | 43 | # - Saves the PHPStan result cache. |
43 | 44 | # - Ensures version-controlled files are not modified or deleted. |
@@ -277,6 +278,20 @@ jobs: |
277 | 278 | name: ${{ matrix.artifact }} |
278 | 279 | path: ${{ runner.temp }}/phpstan-results/ |
279 | 280 |
|
| 281 | + # The extensions in `tests/phpstan` are tested against fixtures rather than against |
| 282 | + # core, so a defect in one is reported here as a failing test rather than as a |
| 283 | + # change in what the analysis above reports. |
| 284 | + # |
| 285 | + # This runs after the results are reported and uploaded, so that a failing test |
| 286 | + # does not also keep the pull request from being annotated and commented on. It |
| 287 | + # runs even when the analysis failed, since the two are independent, but not when |
| 288 | + # the analysis was skipped: that means a step setting up the job, such as installing |
| 289 | + # the Composer dependencies, failed, and the tests could only fail along with it. |
| 290 | + # Both analyses load the same extensions, so the tests run in only one of them. |
| 291 | + - name: Run the tests of the PHPStan extensions |
| 292 | + if: ${{ !cancelled() && steps.phpstan.outcome != 'skipped' && matrix.analysis == 'default' && hashFiles('tests/phpstan/phpunit.xml.dist') != '' }} |
| 293 | + run: composer run phpstan:test |
| 294 | + |
280 | 295 | # Some errors cannot be ignored, so they cannot be reported as warnings either. Most often |
281 | 296 | # this is an ignored error that no longer occurs, or occurs a different number of times, |
282 | 297 | # which is reported under an `ignore.*` identifier. That is not something to fix in the |
|
0 commit comments