ci: exclude .github/ from PHP 7.4 lint + fix PHPCS allow-plugins
Agent-Session: cowork-ci-parity-20260414
This commit is contained in:
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -30,12 +30,15 @@ jobs:
|
|||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
coverage: none
|
coverage: none
|
||||||
- name: Syntax check all PHP files
|
- 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: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
find . -name '*.php' \
|
find . -name '*.php' \
|
||||||
-not -path './vendor/*' \
|
-not -path './vendor/*' \
|
||||||
-not -path './node_modules/*' \
|
-not -path './node_modules/*' \
|
||||||
-not -path './.git/*' \
|
-not -path './.git/*' \
|
||||||
|
-not -path './.github/*' \
|
||||||
-print0 | xargs -0 -n1 -P4 php -l > /dev/null
|
-print0 | xargs -0 -n1 -P4 php -l > /dev/null
|
||||||
|
|
||||||
phpcs:
|
phpcs:
|
||||||
@@ -52,6 +55,8 @@ jobs:
|
|||||||
tools: composer:v2, phpcs
|
tools: composer:v2, phpcs
|
||||||
- name: Install WordPress Coding Standards
|
- name: Install WordPress Coding Standards
|
||||||
run: |
|
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
|
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"
|
phpcs --config-set installed_paths "$(composer global config home)/vendor/wp-coding-standards/wpcs"
|
||||||
- name: Run PHPCS
|
- name: Run PHPCS
|
||||||
|
|||||||
Reference in New Issue
Block a user