Skip to content

Commit 2c853c7

Browse files
committed
Workflows: more PHPUnit matrix tweaks for PHP 7.2/7.4 & PHPStan.
1 parent 46e5493 commit 2c853c7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/phpunit-ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ jobs:
113113
${{ runner.os }}-composer-
114114
115115
- name: Install Composer dependencies
116-
run: composer install --no-interaction --prefer-dist --no-progress
116+
run: |
117+
# For PHP 7.2, we need to ignore platform requirements since some dev dependencies require PHP 7.4+
118+
if [ "${{ matrix.php }}" = "7.2" ]; then
119+
composer install --no-interaction --prefer-dist --no-progress --ignore-platform-req=php
120+
else
121+
composer install --no-interaction --prefer-dist --no-progress
122+
fi
117123
118124
- name: Install system dependencies
119125
run: |
@@ -154,7 +160,13 @@ jobs:
154160
echo "Resolved PHPUnit version: ${PHPUNIT_VERSION}"
155161
156162
# Try to install via composer
157-
composer require --dev --no-interaction --prefer-dist --update-with-dependencies "phpunit/phpunit:${PHPUNIT_VERSION}" || {
163+
# For PHP 7.2, use platform override to allow installation of packages with higher PHP requirements
164+
COMPOSER_OPTS=""
165+
if [ "${{ matrix.php }}" = "7.2" ]; then
166+
COMPOSER_OPTS="--ignore-platform-req=php"
167+
fi
168+
169+
composer require --dev --no-interaction --prefer-dist --update-with-dependencies ${COMPOSER_OPTS} "phpunit/phpunit:${PHPUNIT_VERSION}" || {
158170
echo "Composer install failed, attempting PHAR fallback"
159171
160172
# Determine PHAR version

0 commit comments

Comments
 (0)