Merge pull request #1644 from liip/php-85 #745
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: PHPUnit | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - 1.x | |
| - 2.x | |
| jobs: | |
| phpunit: | |
| name: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] | |
| dependencies: [highest] | |
| symfony: ['*'] | |
| stability: ['stable'] | |
| include: | |
| # Minimum supported dependencies with the oldest supported PHP version | |
| - php: '7.2' | |
| dependencies: lowest | |
| symfony: '*' | |
| stability: 'stable' | |
| # Minimum supported dependencies with the latest supported PHP version | |
| - php: '8.5' | |
| dependencies: lowest | |
| symfony: '*' | |
| stability: 'stable' | |
| # Test each supported Symfony version with the lowest supported PHP version | |
| - php: '7.2' | |
| dependencies: highest | |
| symfony: '5.4.*' | |
| stability: 'stable' | |
| - php: '8.1' | |
| dependencies: highest | |
| symfony: '6.4.*' | |
| stability: 'stable' | |
| # Test Symfony 7.4 | |
| - php: '8.5' | |
| dependencies: highest | |
| symfony: '7.4.*' | |
| stability: 'stable' | |
| # Test Symfony 8.0 | |
| - php: '8.5' | |
| dependencies: highest | |
| symfony: '8.0.*' | |
| stability: 'stable' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Configure coverage driver | |
| id: coverage | |
| run: echo ::set-output name=driver::xdebug | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: ${{ steps.coverage.outputs.driver }} | |
| extensions: gd, imagick | |
| - name: Install symfony/flex | |
| run: | | |
| composer global config --no-plugins allow-plugins.symfony/flex true | |
| composer global require --no-interaction --no-progress symfony/flex | |
| - name: Set minimum-stability | |
| run: composer config minimum-stability ${{ matrix.stability }} | |
| - name: Remove enqueue/enqueue-bundle for Symfony 8 | |
| if: matrix.symfony == '8.0.*' | |
| run: composer remove --no-update enqueue/enqueue-bundle --dev | |
| # Latest enqueue install on PHP 7.4 but uses PHP 8 features | |
| - name: Pin enqueue/enqueue on PHP 7.4 | |
| if: ${{ matrix.php == '7.4' }} | |
| run: composer require --no-update enqueue/enqueue 0.10.18 | |
| - name: Update project dependencies | |
| uses: ramsey/composer-install@v2 | |
| with: | |
| dependency-versions: ${{ matrix.dependencies }} | |
| env: | |
| SYMFONY_REQUIRE: "${{ matrix.symfony }}" | |
| - name: Cache PHPUnit | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor/bin/.phpunit | |
| key: ${{ runner.os }}-phpunit-${{ matrix.php }} | |
| - name: Install PHPUnit | |
| run: vendor/bin/simple-phpunit install | |
| - name: Run PHPUnit tests | |
| env: | |
| SYMFONY_DEPRECATIONS_HELPER: max[self]=0 | |
| run: vendor/bin/simple-phpunit -v | |
| - name: Install php-coveralls | |
| run: composer global require --no-interaction --no-progress php-coveralls/php-coveralls | |
| - name: Upload coverage results to Coveralls | |
| uses: nick-invision/retry@v2 | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_PARALLEL: true | |
| COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}" | |
| with: | |
| timeout_seconds: 60 | |
| max_attempts: 3 | |
| command: php-coveralls -x var/build/clover.xml -o var/build/upload.json -v | |
| coveralls-finish: | |
| needs: [phpunit] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Notify Coveralls when build is finished | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel-finished: true |