Support Symfony 8 #1
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| pull_request: | |
| branches: [ "main", "develop" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - php-version: '8.2' | |
| symfony-version: '6.4.*' | |
| - php-version: '8.2' | |
| symfony-version: '7.0.*' | |
| name: PHP ${{ matrix.php-version }} · SF ${{ matrix.symfony-version }} | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: test | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: mbstring, xml, ctype, iconv, intl, json | |
| coverage: ${{ matrix.symfony-version == '7.0.*' && 'pcov' || 'none' }} | |
| - name: Constrain Symfony version | |
| run: | | |
| sed -ri 's/"symfony\/([^"]+)": "[^"]+"/"symfony\/\1": "${{ matrix.symfony-version }}"/g' composer.json | |
| - name: Install Composer dependencies | |
| uses: ramsey/composer-install@v3 | |
| with: | |
| composer-options: "--prefer-dist --no-progress --no-interaction --optimize-autoloader" | |
| - name: Run PHP-CS-Fixer | |
| if: matrix.symfony-version == '7.0.*' | |
| run: vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --using-cache=no | |
| - name: Run PHPStan | |
| if: matrix.symfony-version == '7.0.*' | |
| run: vendor/bin/phpstan analyse src tests --configuration=phpstan.neon --memory-limit=1G | |
| - name: Run PHPUnit tests | |
| env: | |
| DATABASE_URL: mysql://root:root@127.0.0.1:3306/test?serverVersion=8.0 | |
| run: vendor/bin/phpunit ${{ matrix.symfony-version == '7.0.*' && '--coverage-clover coverage.xml' || '' }} | |
| - name: Upload coverage to Codecov | |
| if: matrix.symfony-version == '7.0.*' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false |