|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + branches: [ '*.x' ] |
| 7 | + workflow_dispatch: |
| 8 | + schedule: |
| 9 | + - cron: '0 8 * * *' |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + phpunit: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ] |
| 22 | + symfony: [ '6.4', '7.4', '8.0', '8.1' ] |
| 23 | + dependencies: [ 'highest', 'lowest' ] |
| 24 | + exclude: |
| 25 | + - php: '8.1' |
| 26 | + symfony: '7.4' |
| 27 | + - php: '8.1' |
| 28 | + symfony: '8.0' |
| 29 | + - php: '8.2' |
| 30 | + symfony: '8.0' |
| 31 | + - php: '8.3' |
| 32 | + symfony: '8.0' |
| 33 | + - php: '8.1' |
| 34 | + symfony: '8.1' |
| 35 | + - php: '8.2' |
| 36 | + symfony: '8.1' |
| 37 | + - php: '8.3' |
| 38 | + symfony: '8.1' |
| 39 | + env: |
| 40 | + SYMFONY_REQUIRE: ${{ matrix.symfony }}.* |
| 41 | + name: PHP ${{ matrix.php }} & Symfony ${{ matrix.symfony }}${{ matrix.dependencies == 'lowest' && ' (lowest)' || '' }} Test |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v7 |
| 45 | + |
| 46 | + - name: Setup PHP |
| 47 | + uses: shivammathur/setup-php@v2 |
| 48 | + with: |
| 49 | + php-version: ${{ matrix.php }} |
| 50 | + ini-values: zend.exception_ignore_args=false |
| 51 | + tools: flex |
| 52 | + |
| 53 | + - name: Downgrade PHPUnit for PHP 8.1 |
| 54 | + if: matrix.php == '8.1' |
| 55 | + run: | |
| 56 | + composer require --dev --no-update phpunit/phpunit:^10.5 |
| 57 | + sed -i 's/failOnPhpunitDeprecation="true"//g' phpunit.dist.xml |
| 58 | + sed -i 's/failOnPhpunitNotice="true"//g' phpunit.dist.xml |
| 59 | +
|
| 60 | + - name: Downgrade PHPUnit for PHP 8.2 |
| 61 | + if: matrix.php == '8.2' |
| 62 | + run: | |
| 63 | + composer require --dev --no-update phpunit/phpunit:^11.5 |
| 64 | + sed -i 's/failOnPhpunitNotice="true"//g' phpunit.dist.xml |
| 65 | +
|
| 66 | + - name: Install Dependencies |
| 67 | + uses: ramsey/composer-install@v3 |
| 68 | + with: |
| 69 | + composer-options: '--prefer-dist' |
| 70 | + dependency-versions: ${{ matrix.dependencies }} |
| 71 | + |
| 72 | + - name: Run Tests |
| 73 | + run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml |
| 74 | + |
| 75 | + - name: Upload Coverage to Codecov |
| 76 | + if: ${{ success() }} |
| 77 | + uses: codecov/codecov-action@v7 |
| 78 | + with: |
| 79 | + files: coverage.xml |
| 80 | + flags: ${{ matrix.php }} |
| 81 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments