From 681317b9981689507284e89fb66eb80d9aded736 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 4 Oct 2022 00:43:30 +0000 Subject: [PATCH] Build/Test Tools: Display PHPCS results in the GitHub Action logs. When running PHPCS scans (both for checking coding standards and PHP version compatibility), the results are currently only returned silently in a format that GitHub can consume for contextually annotating any code being flagged. This changes workflows using PHPCS to also display the results of each scan in the GitHub Action log, making it easier to find and understand what is causing failures. Props jrf. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54371 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/coding-standards.yml | 12 ++++++++++-- .github/workflows/php-compatibility.yml | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index b4bf70b7c8..0199489252 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -102,10 +102,18 @@ jobs: run: phpcs -i - name: Run PHPCS on all Core files - run: phpcs -q -n --report=checkstyle | cs2pr + continue-on-error: true + run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml + + - name: Show PHPCS results in PR + run: cs2pr ./.cache/phpcs-report.xml - name: Check test suite files for warnings - run: phpcs tests -q --report=checkstyle | cs2pr + continue-on-error: true + run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml + + - name: Show test suite scan results in PR + run: cs2pr ./.cache/phpcs-tests-report.xml - name: Ensure version-controlled files are not modified during the tests run: git diff --exit-code diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index c92e059675..038d4d2bec 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -97,7 +97,11 @@ jobs: run: phpcs -i - name: Run PHP compatibility tests - run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr + continue-on-error: true + run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml + + - name: Show PHPCompatibility results in PR + run: cs2pr ./.cache/phpcs-compat-report.xml - name: Ensure version-controlled files are not modified or deleted run: git diff --exit-code