Skip to content

Commit dffdc71

Browse files
committed
minor symfony#41080 Add a GitHub Action for tests against PHP 8.1 (derrabus, Nyholm)
This PR was merged into the 4.4 branch. Discussion ---------- Add a GitHub Action for tests against PHP 8.1 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A I'd like to monitor our compatibility with the upcoming PHP 8.1 release. Because I failed miserably at convincing Travis to run our tests with PHP 8.1 (see symfony#40532), I tried to do the same with GitHub Actions. Commits ------- 6a328ae Update .github/workflows/tests.yml 6f1c4b8 PHP 8.1 must not cause the build to fail (yet) b0b4510 Add _run_tests bash function de4f017 Add a GitHub Action for tests against PHP 8.1
2 parents 3b0c6f9 + 6a328ae commit dffdc71

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/tests.yml

+55
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,58 @@ jobs:
114114
docker run --rm -e COMPOSER_ROOT_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
115115
sudo rm -rf .phpunit
116116
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
117+
118+
nightly:
119+
name: PHPUnit on PHP nightly
120+
runs-on: Ubuntu-20.04
121+
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v2
125+
126+
- name: Setup PHP
127+
uses: shivammathur/setup-php@v2
128+
with:
129+
coverage: "none"
130+
ini-values: "memory_limit=-1"
131+
php-version: "8.1"
132+
133+
- name: Configure composer
134+
run: |
135+
COMPOSER_HOME="$(composer config home)"
136+
composer self-update
137+
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
138+
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
139+
140+
- name: Install dependencies
141+
run: |
142+
echo "::group::fake PHP version"
143+
composer config platform.php 8.0.99
144+
echo "::group::composer update"
145+
composer update --no-progress --ansi
146+
echo "::endgroup::"
147+
echo "::group::install phpunit"
148+
./phpunit install
149+
echo "::endgroup::"
150+
151+
- name: Run tests
152+
run: |
153+
_run_tests() {
154+
ok=0
155+
echo "::group::$1"
156+
157+
# Run the tests
158+
./phpunit --colors=always --exclude-group tty,benchmark,intl-data ./$1 2>&1 || ok=1
159+
echo ::endgroup::
160+
161+
if [ $ok -ne 0 ]; then
162+
echo "::error::$1 failed"
163+
fi
164+
165+
# Make the tests always pass because we don't want the build to fail (yet).
166+
return 0
167+
#return $ok
168+
}
169+
export -f _run_tests
170+
171+
find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -print0 | xargs -0 -n1 dirname | sort | parallel _run_tests

0 commit comments

Comments
 (0)