diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 393f031..b05ccda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,12 +30,15 @@ jobs: php-version: ${{ matrix.php }} coverage: none - name: Syntax check all PHP files + # Exclude .github/mu-plugins — those run on the production server (PHP 8+) + # and may use PHP 8+ syntax (union types etc.) that 7.4 rejects. run: | set -e find . -name '*.php' \ -not -path './vendor/*' \ -not -path './node_modules/*' \ -not -path './.git/*' \ + -not -path './.github/*' \ -print0 | xargs -0 -n1 -P4 php -l > /dev/null phpcs: @@ -52,6 +55,8 @@ jobs: tools: composer:v2, phpcs - name: Install WordPress Coding Standards run: | + # Allow the PHPCS composer-installer plugin (auto-registers standards). + composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true composer global require "wp-coding-standards/wpcs:^3.0" "phpcsstandards/phpcsutils:^1.0" --no-interaction phpcs --config-set installed_paths "$(composer global config home)/vendor/wp-coding-standards/wpcs" - name: Run PHPCS