Bump test config to PHPUnit 10 #476
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- 'master' | |
- '[0-9].[0-9]+' | |
pull_request: ~ | |
env: | |
COMPOSER_ROOT_VERSION: dev-master | |
jobs: | |
tests: | |
name: ${{ matrix.php }} / ${{ matrix.symfony }} / ${{ matrix.phpunit }} / ${{ matrix.db }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['7.4', '8.1'] | |
symfony: ['~5.4.0', '~6.3.0'] | |
phpunit: ['phpunit.xml', 'phpunit-api.xml'] | |
db: ['sqlite'] | |
deps: ['normal'] | |
include: | |
- php: '7.4' | |
symfony: '~3.4.0' | |
phpunit: 'phpunit.xml' | |
db: 'sqlite' | |
- php: '7.4' | |
symfony: '~3.4.0' | |
phpunit: 'phpunit-api-legacy.xml' | |
db: 'sqlite' | |
- php: '7.4' | |
symfony: '~5.4.0' | |
phpunit: 'phpunit.xml' | |
db: 'mysql' | |
- php: '7.4' | |
symfony: '~5.4.0' | |
phpunit: 'phpunit-api.xml' | |
db: 'mysql' | |
- php: '8.1' | |
symfony: '~6.3.0' | |
phpunit: 'phpunit.xml' | |
db: 'postgres' | |
- php: '8.1' | |
symfony: '~6.3.0' | |
phpunit: 'phpunit-api.xml' | |
db: 'postgres' | |
- php: '7.4' | |
symfony: '~3.4.0' | |
phpunit: 'phpunit.xml' | |
db: 'sqlite' | |
deps: 'low' | |
- php: '7.4' | |
symfony: '~3.4.0' | |
phpunit: 'phpunit-api-legacy.xml' | |
db: 'sqlite' | |
deps: 'low' | |
exclude: | |
- php: '8.1' | |
symfony: '~3.4.0' | |
- php: '7.4' | |
symfony: '~6.3.0' | |
services: | |
mysql: | |
image: 'mysql:latest' | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: testdb | |
ports: | |
- '3306:3306' | |
postgres: | |
image: 'postgres:latest' | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: testdb | |
ports: | |
- '5432:5432' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
- run: composer --version | |
- run: composer validate --strict | |
- run: echo "DATABASE=mysql://[email protected]/testdb" >> $GITHUB_ENV | |
if: ${{ matrix.db == 'mysql' }} | |
- run: echo "DATABASE=pgsql://postgres:[email protected]/testdb" >> $GITHUB_ENV | |
if: ${{ matrix.db == 'postgres' }} | |
# Install Flex as a global dependency to enable usage of extra.symfony.require | |
# while keeping Flex recipes from applying | |
- run: composer global config --no-plugins allow-plugins.symfony/flex true | |
- run: composer global require --no-scripts symfony/flex | |
- run: composer config extra.symfony.require ${{ matrix.symfony }} | |
# Adds a dependency required for Symfony 3.4 tests due to incompatibility | |
# of symfony/proxy-manager-bridge and laminas/laminas-code | |
- run: composer require --dev --no-update laminas/laminas-zendframework-bridge | |
if: ${{ matrix.symfony == '~3.4.0' }} | |
- | |
run: composer update --prefer-dist | |
if: ${{ matrix.deps != 'low' }} | |
- | |
run: composer update --prefer-dist --prefer-lowest --prefer-stable | |
if: ${{ matrix.deps == 'low' }} | |
- run: vendor/bin/phpunit -c ${{ matrix.phpunit }} --colors=always |