Merge pull request #672 from timfennis/feat/phpunit-13-support #336
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: Tests | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| name: Symfony ${{ matrix.symfony-version }} - 🐘 ${{ matrix.php-version }} - PHPUnit ${{ matrix.phpunit-version }} - 🏳️ ${{ matrix.composer-flags || 'Ø' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Symfony 6.4 requires PHP >= 8.0, it will be installed on PHP >= 8.0 | |
| # Symfony 7.0 requires PHP >= 8.2, it will be installed on PHP >= 8.2 | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| composer-flags: [''] | |
| symfony-version: ['^6.4'] | |
| phpunit-version: ['^9.6'] | |
| include: | |
| - php-version: 8.0 | |
| symfony-version: "^5.4" | |
| phpunit-version: '^9.6' | |
| composer-flags: "--prefer-lowest" | |
| - php-version: 8.1 | |
| symfony-version: "^5.4" | |
| phpunit-version: "^10.0" | |
| - php-version: 8.1 | |
| symfony-version: "^6.4" | |
| phpunit-version: "^10.0" | |
| - php-version: 8.2 | |
| symfony-version: "^6.4" | |
| phpunit-version: "^10.0" | |
| - php-version: 8.2 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^10.0" | |
| - php-version: 8.3 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^10.0" | |
| - php-version: 8.2 | |
| symfony-version: "^6.4" | |
| phpunit-version: "^11.0" | |
| - php-version: 8.2 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^11.0" | |
| - php-version: 8.3 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^11.0" | |
| - php-version: 8.4 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^11.0" | |
| - php-version: 8.4 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^12.0" | |
| - php-version: 8.5 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^12.0" | |
| - php-version: 8.4 | |
| symfony-version: "^8.0" | |
| phpunit-version: "^12.0" | |
| - php-version: 8.5 | |
| symfony-version: "^8.0" | |
| phpunit-version: "^12.0" | |
| - php-version: 8.4 | |
| symfony-version: "^7.0" | |
| phpunit-version: "^13.0" | |
| - php-version: 8.4 | |
| symfony-version: "^8.0" | |
| phpunit-version: "^13.0" | |
| - php-version: 8.5 | |
| symfony-version: "^8.0" | |
| phpunit-version: "^13.0" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| - name: Get composer cache directory | |
| id: composercache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composercache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Require Symfony | |
| # non-dev then dev dependencies | |
| run: > | |
| composer require --no-update | |
| symfony/framework-bundle=${{ matrix.symfony-version }} | |
| symfony/browser-kit=${{ matrix.symfony-version }} | |
| && | |
| composer require --dev --no-update | |
| symfony/css-selector=${{ matrix.symfony-version }} | |
| symfony/form=${{ matrix.symfony-version }} | |
| symfony/http-kernel=${{ matrix.symfony-version }} | |
| symfony/security-bundle=${{ matrix.symfony-version }} | |
| symfony/twig-bundle=${{ matrix.symfony-version }} | |
| symfony/validator=${{ matrix.symfony-version }} | |
| symfony/yaml=${{ matrix.symfony-version }} | |
| phpunit/phpunit=${{ matrix.phpunit-version }} | |
| # This is needed to fix builds where the `annotation_reader` service may not be set up if | |
| # the doctrine/annotations package is not in the production dependencies | |
| - name: Move doctrine/annotations v1/v2 to require (non-dev) for PHP 8+ | |
| run: composer require --no-update "doctrine/annotations:^1.8.0|^2.0" | |
| - name: Install Composer dependencies | |
| if: matrix.composer-flags == '' | |
| run: composer install | |
| - name: Install Composer dependencies with options | |
| if: matrix.composer-flags != '' | |
| # Use "update" instead of "install" since it allows using the "--prefer-lowest" option | |
| run: composer update ${{ matrix.composer-flags }} | |
| - name: Show Composer dependencies | |
| run: composer show | |
| - name: 🧪 Run tests | |
| run: php ./vendor/bin/phpunit --testdox |