Skip to content

Commit f6e349e

Browse files
authored
Workflow Updates
1 parent 1375f48 commit f6e349e

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.github/workflows/php-code-quality.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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: |

.github/workflows/wordpress-tests.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ jobs:
8686
composer-options: "--prefer-dist --no-progress"
8787
continue-on-error: true
8888

89+
- name: Verify Composer installation
90+
run: |
91+
if [ ! -d "vendor" ]; then
92+
echo "::warning::Composer vendor directory not found. Installing dependencies manually."
93+
composer install --no-progress
94+
fi
95+
if [ ! -f "vendor/bin/phpunit" ]; then
96+
echo "::warning::PHPUnit not found in vendor/bin. Installing phpunit explicitly."
97+
composer require phpunit/phpunit:^7.5 --dev --no-progress
98+
fi
99+
89100
- name: Check Test Environment
90101
id: check-test-env
91102
run: |
@@ -111,4 +122,10 @@ jobs:
111122
- name: Run tests
112123
if: steps.check-test-env.outputs.test_env_ready == 'true'
113124
run: |
114-
composer test
125+
if [ -f "vendor/bin/phpunit" ]; then
126+
vendor/bin/phpunit
127+
else
128+
echo "::error::PHPUnit executable not found in vendor/bin directory."
129+
ls -la vendor/bin || echo "vendor/bin directory not found"
130+
exit 1
131+
fi

0 commit comments

Comments
 (0)