Update to Symfony 8.1 #789
Workflow file for this run
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, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: ["8.2", "8.5"] | |
| symfony: ["5.4", "6.4", "7.4", "8.1"] | |
| exclude: | |
| - php: "8.2" | |
| symfony: "8.1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: pcov | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/composer | |
| key: php-${{ matrix.php }}-sf-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: php-${{ matrix.php }}-sf-${{ matrix.symfony }}- | |
| - uses: actions/checkout@v6 | |
| name: Checkout Symfony ${{ matrix.symfony }} app | |
| with: | |
| repository: Codeception/symfony-module-tests | |
| path: framework-tests | |
| ref: ${{ matrix.symfony }} | |
| - name: Install dependencies | |
| run: | | |
| sed -i "s/\^5.4 | \^6.4 | \^7.4 | \^8.1/${{ matrix.symfony }}.*/g" composer.json | |
| # doctrine/orm requires symfony/var-exporter >=6.3.9, so it can't be pinned to 5.4.* | |
| if [ "${{ matrix.symfony }}" = "5.4" ]; then | |
| sed -i 's#"symfony/var-exporter": "5\.4\.\*"#"symfony/var-exporter": "^6.4 | ^7.4"#' composer.json | |
| fi | |
| composer install --prefer-dist --no-progress | |
| - name: Quality checks | |
| if: matrix.symfony == '8.1' | |
| run: composer validate --strict && composer audit && composer cs-check && composer phpstan | |
| - name: Run module tests | |
| run: vendor/bin/phpunit tests ${{ matrix.symfony == '8.1' && '--coverage-text --coverage-filter src' || '' }} | |
| - name: Prepare Symfony app & run tests | |
| run: | | |
| composer -d framework-tests remove codeception/module-symfony --dev --no-update | |
| composer -d framework-tests install --no-progress | |
| php framework-tests/bin/console doctrine:schema:update --force | |
| php framework-tests/bin/console doctrine:fixtures:load --quiet | |
| php vendor/bin/codecept run Functional -c framework-tests | |
| if [ "${{ matrix.symfony }}" = "7.4" ]; then | |
| composer remove symfony/messenger --dev --no-interaction | |
| composer require codeception/module-rest:^3.4 --dev | |
| git -C framework-tests checkout -- composer.json | |
| patch -d framework-tests -p1 --fuzz=3 --no-backup-if-mismatch < framework-tests/resetFormatsAfterRequest_issue_test.patch | |
| composer -d framework-tests update --no-progress | |
| php framework-tests/bin/console lexik:jwt:generate-keypair --skip-if-exists | |
| php vendor/bin/codecept run Functional -c framework-tests | |
| fi |