Skip to content

Commit eb53ac6

Browse files
authored
Fix compatibility with phpunit 10 (#1732)
1 parent fa7ccbd commit eb53ac6

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

.github/workflows/ci.yml

+11-16
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ jobs:
4646
key: composer-${{ github.sha }}
4747
restore-keys: composer-
4848

49-
- name: Download phpunit
50-
run: |
51-
rm composer.*
52-
composer init --no-interaction --name "async-aws/aws"
53-
54-
echo ::group::Download
55-
composer require symfony/phpunit-bridge
56-
echo ::endgroup::
57-
58-
echo ::group::Install
59-
./vendor/bin/simple-phpunit install
60-
echo ::endgroup::
61-
6249
- name: Modify composer.json - default
6350
run: |
6451
CURRENT_DIR=$(pwd)
@@ -69,7 +56,9 @@ jobs:
6956
cd "$CURRENT_DIR/$COMPONENT"
7057
7158
sed -i -re 's/"require": \{/"repositories": [{"type": "path","url": "..\/..\/Core", "options": {"versions": {"async-aws\/core": "dev-master"}}, "canonical": ${{matrix.strategy != 'lowest' && 'true' || 'false'}} }],"require": \{/' composer.json
72-
sed -i -re 's/"require": \{/"minimum-stability": "dev","prefer-stable": true,"require": \{/' composer.json
59+
composer config minimum-stability dev
60+
composer config prefer-stable true
61+
composer require --dev --no-update symfony/phpunit-bridge
7362
cat composer.json
7463
7564
echo ::endgroup::
@@ -82,7 +71,9 @@ jobs:
8271
echo "$CURRENT_DIR/$COMPONENT"
8372
cd "$CURRENT_DIR/$COMPONENT"
8473
85-
sed -i -re 's/"require": \{/"minimum-stability": "dev","prefer-stable": true,"require": \{/' composer.json
74+
sed -i -re 's/"require": \{/"conflict": \{"phpunit\/phpunit": ">=10.0"\},"require": \{/' composer.json
75+
composer config minimum-stability dev
76+
composer config prefer-stable true
8677
cat composer.json
8778
8879
echo ::endgroup::
@@ -102,7 +93,9 @@ jobs:
10293
cd "$CURRENT_DIR/$COMPONENT"
10394
10495
localExit=0
96+
composer require symfony/phpunit-bridge --no-update --no-install
10597
composer update --no-interaction --no-scripts --prefer-dist --optimize-autoloader ${{ matrix.strategy == 'lowest' && '--prefer-lowest' || '' }} $COMPOSER_OPTIONS || localExit=1
98+
./vendor/bin/simple-phpunit install
10699
echo ::endgroup::
107100
if [ $localExit -ne 0 ]; then
108101
echo "::error::$COMPONENT error"
@@ -118,11 +111,13 @@ jobs:
118111
if [ -n "$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER" ]; then
119112
export SYMFONY_DEPRECATIONS_HELPER=$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER
120113
fi
114+
CURRENT_DIR=$(pwd)
121115
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
122116
do
123117
echo ::group::$COMPONENT
124118
localExit=0
125-
./vendor/bin/simple-phpunit -c ./$COMPONENT 2>&1 || localExit=1
119+
cd "$CURRENT_DIR/$COMPONENT"
120+
./vendor/bin/simple-phpunit 2>&1 || localExit=1
126121
ok=$(( $localExit || $ok ))
127122
echo ::endgroup::
128123
if [ $localExit -ne 0 ]; then

0 commit comments

Comments
 (0)