diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83da62422a..6d5ae3102a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -195,7 +195,6 @@ jobs: php-version: ${{ matrix.php }} ini-values: ${{ steps.set_ini.outputs.PHP_INI }} coverage: none - tools: cs2pr - name: "DEBUG: show libxml loaded version (php)" run: php -r 'echo "libxml loaded version = ", LIBXML_LOADED_VERSION, PHP_EOL;' @@ -240,14 +239,7 @@ jobs: - name: 'PHPCS: check code style without cache, no parallel' if: ${{ matrix.custom_ini == false }} - id: phpcs - run: > - php "bin/phpcs" --no-cache --parallel=1 - ${{ matrix.os == 'ubuntu-latest' && matrix.php == '8.4' && '--report-full --report-checkstyle=./phpcs-report.xml' || '' }} - - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' && matrix.os == 'ubuntu-latest' && matrix.php == '8.4' }} - run: cs2pr ./phpcs-report.xml + run: php "bin/phpcs" --no-cache --parallel=1 - name: Download the PHPCS phar if: ${{ matrix.custom_ini == false }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 60ca01ad0c..f898515291 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,6 +17,32 @@ concurrency: cancel-in-progress: true jobs: + phpcs: + name: Check PHP code style + runs-on: ubuntu-latest + + # Don't run the cronjob in this workflow on forks. + if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 'latest' + coverage: none + tools: cs2pr + + - name: Check PHP code style + id: phpcs + run: php "bin/phpcs" --report-full --report-checkstyle=./phpcs-report.xml + + - name: Show PHPCS results in PR + if: ${{ always() && steps.phpcs.outcome == 'failure' }} + run: cs2pr ./phpcs-report.xml + checkxml: name: Check XML files runs-on: ubuntu-latest