Merge branch '3.x' into 4.x #440
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: 'Run Tests' | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.can-fail }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| symfony: ['5.4.*', '6.4.*', '7.3.*', '7.4.*', '8.0.*'] | |
| pagerfanta: [''] | |
| composer-flags: ['--prefer-stable'] | |
| can-fail: [false] | |
| with-jms: [true] | |
| with-twig: [true] | |
| include: | |
| # Run "no Twig" build on latest PHP and Symfony LTS | |
| - php: '8.4' | |
| symfony: '6.4.*' | |
| composer-flags: '--prefer-stable' | |
| can-fail: false | |
| with-jms: true | |
| with-twig: false | |
| - php: '8.1' | |
| symfony: '5.4.*' | |
| composer-flags: '--prefer-stable --prefer-lowest' | |
| can-fail: false | |
| with-jms: true | |
| with-twig: true | |
| exclude: | |
| - php: '8.1' | |
| symfony: '7.3.*' | |
| - php: '8.1' | |
| symfony: '7.4.*' | |
| - php: '8.1' | |
| symfony: '8.0.*' | |
| - php: '8.2' | |
| symfony: '8.0.*' | |
| - php: '8.3' | |
| symfony: '8.0.*' | |
| name: "PHP ${{ matrix.php }}${{ matrix.pagerfanta != '' && format(' - Pagerfanta {0}', matrix.pagerfanta) || '' }}${{ matrix.with-twig == false && ' - Without Twig' || '' }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache/files | |
| key: dependencies-symfony-${{ matrix.symfony }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2,flex | |
| extensions: curl, iconv, mbstring, pdo, pdo_sqlite, sqlite, zip | |
| coverage: none | |
| - name: Restrict Pagerfanta version | |
| if: ${{ matrix.pagerfanta }} | |
| run: | | |
| composer require --no-update pagerfanta/core:${{ matrix.pagerfanta }} | |
| composer require --dev --no-update pagerfanta/twig:${{ matrix.pagerfanta }} | |
| - name: Remove JMS Serializer | |
| if: matrix.with-jms == false | |
| run: composer remove --dev --no-update jms/serializer jms/serializer-bundle | |
| - name: Remove Twig | |
| if: matrix.with-twig == false | |
| run: composer remove --dev --no-update pagerfanta/twig symfony/twig-bridge symfony/twig-bundle twig/twig | |
| - name: Install dependencies | |
| run: composer update ${{ matrix.composer-flags }} --prefer-dist | |
| env: | |
| SYMFONY_REQUIRE: ${{ matrix.symfony }} | |
| - name: Execute tests | |
| run: vendor/bin/phpunit |