@@ -28,24 +28,33 @@ jobs:
2828 - name : Setup PHP
2929 uses : shivammathur/setup-php@v2
3030 with :
31- php-version : ' 8.0 '
31+ php-version : ' 7.4 '
3232 extensions : mbstring, intl, curl
3333 tools : composer:v2, phpcs, wp-coding-standards
3434
3535 - name : Install dependencies
36- run : composer install --prefer-dist --no-progress
36+ run : |
37+ # First try and handle dependency conflicts
38+ composer config platform.php 7.4
39+ composer install --prefer-dist --no-progress --no-suggest || {
40+ echo "Standard install failed, trying with --ignore-platform-reqs"
41+ composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
42+ }
3743
3844 - name : Run PHP_CodeSniffer
3945 run : |
4046 if [ -f phpcs.xml ] || [ -f phpcs.xml.dist ]; then
41- ./ vendor/bin/phpcs --standard=phpcs.xml || ./ vendor/bin/phpcs --standard=phpcs.xml.dist
47+ vendor/bin/phpcs --standard=phpcs.xml || vendor/bin/phpcs --standard=phpcs.xml.dist
4248 else
43- ./ vendor/bin/phpcs --standard=WordPress-Core --extensions=php --ignore=vendor/,node_modules/ .
49+ vendor/bin/phpcs --standard=WordPress-Core --extensions=php --ignore=vendor/,node_modules/ .
4450 fi
4551
4652 - name : Run PHP Compatibility Check
4753 run : |
48- ./vendor/bin/phpcs --standard=PHPCompatibilityWP --extensions=php --ignore=vendor/,node_modules/ --runtime-set testVersion 7.0- .
54+ # Install PHP compatibility standards if they're not already installed
55+ composer require --dev phpcompatibility/php-compatibility wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer --no-interaction || true
56+ vendor/bin/phpcs --config-set installed_paths $(pwd)/vendor/phpcompatibility/php-compatibility || true
57+ vendor/bin/phpcs --standard=PHPCompatibilityWP --extensions=php --ignore=vendor/,node_modules/ --runtime-set testVersion 7.0- .
4958
5059 - name : Check PHP syntax
5160 run : |
0 commit comments