Make WordPress Core

Changeset 54678


Ignore:
Timestamp:
10/24/2022 04:47:15 PM (2 years ago)
Author:
desrosj
Message:

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.

Location:
trunk/.github/workflows
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/coding-standards.yml

    r54674 r54678  
    103103
    104104      - name: Run PHPCS on all Core files
    105         continue-on-error: true
     105        id: phpcs-core
    106106        run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
    107107
    108108      - name: Show PHPCS results in PR
     109        if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
    109110        run: cs2pr ./.cache/phpcs-report.xml
    110111
    111112      - name: Check test suite files for warnings
    112         continue-on-error: true
     113        id: phpcs-tests
    113114        run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml
    114115
    115116      - name: Show test suite scan results in PR
     117        if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
    116118        run: cs2pr ./.cache/phpcs-tests-report.xml
    117119
  • trunk/.github/workflows/php-compatibility.yml

    r54674 r54678  
    9898
    9999      - name: Run PHP compatibility tests
    100         continue-on-error: true
     100        id: phpcs
    101101        run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
    102102
    103103      - name: Show PHPCompatibility results in PR
     104        if: ${{ always() && steps.phpcs.outcome == 'failure' }}
    104105        run: cs2pr ./.cache/phpcs-compat-report.xml
    105106
Note: See TracChangeset for help on using the changeset viewer.