Make WordPress Core

Changeset 54681


Ignore:
Timestamp:
10/24/2022 05:14:39 PM (16 months 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.
Merges [54678] to the 6.1 branch.
See #55652.

Location:
branches/6.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1

  • branches/6.1/.github/workflows/coding-standards.yml

    r54680 r54681  
    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
  • branches/6.1/.github/workflows/php-compatibility.yml

    r54680 r54681  
    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.