Build/Test Tools: Ensure PHPCS related workflows are properly marked as failed.

When a ruleset error is encountered during a PHPCodeSniffer scan, an XML report is not generated and `cs2pr` will exit with a `0`.

In this situation, a workflow run will be marked as passing (even though a failure has occurred) due to the presence of `continue-on-error`.

This adjusts the logic in the Coding Standards and PHP Compatibility workflows to remove the need for the `continue-on-error` option and ensures all failures are accurately reflected within the GitHub Actions UI.

Follow up to [54371].

Props jrf, TobiasBg.
See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@54678 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2022-10-24 16:47:15 +00:00
parent 2645177a58
commit 28061cb869
2 changed files with 6 additions and 3 deletions

View File

@ -102,17 +102,19 @@ jobs:
run: phpcs -i
- name: Run PHPCS on all Core files
continue-on-error: true
id: phpcs-core
run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-report.xml
- name: Check test suite files for warnings
continue-on-error: true
id: phpcs-tests
run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml
- name: Show test suite scan results in PR
if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-tests-report.xml
- name: Ensure version-controlled files are not modified during the tests

View File

@ -97,10 +97,11 @@ jobs:
run: phpcs -i
- name: Run PHP compatibility tests
continue-on-error: true
id: phpcs
run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
- name: Show PHPCompatibility results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-compat-report.xml
- name: Ensure version-controlled files are not modified or deleted