Improve testing against PHPUnit version 10, 11, and 12 #159
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: Build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - '*' | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| tests: | |
| name: PHP ${{ matrix.php-version }} PHPUnit ${{matrix.phpunit-version}} on ${{ matrix.os }} (${{ matrix.prefer-lowest }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.1" | |
| - "8.2" | |
| - "8.3" | |
| - "8.4" | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macOS-latest | |
| phpunit-version: | |
| - "10" | |
| - "11" | |
| - "12" | |
| prefer-lowest: | |
| - "" | |
| - "--prefer-lowest" | |
| include: | |
| # PHPUnit ^10.5.32 is incompatible with paratest 7.3. | |
| # Paratest 7.4.6, which fixes the incompatibility, requires PHP 8.2 | |
| - php-version: "8.1" | |
| phpunit-version: "10" | |
| update-constraints: "'--with=phpunit/phpunit:<10.5.32'" | |
| exclude: | |
| # PHPUnit ^11 requires PHP 8.2 | |
| - phpunit-version: "11" | |
| php-version: "8.1" | |
| # PHPUnit ^12 requires PHP 8.3 | |
| - phpunit-version: "12" | |
| php-version: "8.1" | |
| - phpunit-version: "12" | |
| php-version: "8.2" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up PHP ${{ matrix.php-version }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: pcntl, posix | |
| coverage: xdebug | |
| ini-values: error_reporting=E_ALL | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Install dependencies | |
| run: composer update | |
| --prefer-dist | |
| --no-progress | |
| ${{ matrix.prefer-lowest }} | |
| ${{ matrix.update-constraints }} | |
| - name: Set PHPUnit schema version | |
| id: set-phpunit-version | |
| run: | | |
| echo "PHPUNIT_SCHEMA_VERSION=$(composer print-phpunit-schema-version)" >> "$GITHUB_OUTPUT" | |
| shell: bash | |
| - name: Show PHPUnit schema version | |
| id: show-phpunit-version | |
| run: | | |
| echo "PHPUNIT_SCHEMA_VERSION=${{ steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION }}" | |
| - name: Run tests | |
| if: ${{ matrix.os != 'windows-latest' && steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION != '10.0' }} | |
| run: composer test | |
| - name: Run tests (phpunit10.0) | |
| if: ${{ matrix.os != 'windows-latest' && steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION == '10.0' }} | |
| run: composer test-phpunit10.0 | |
| - name: Run tests (windows) | |
| if: ${{ matrix.os == 'windows-latest' && steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION != '10.0' }} | |
| run: composer test-windows | |
| - name: Run tests (windows-phpunit10.0) | |
| if: ${{ matrix.os == 'windows-latest' && steps.set-phpunit-version.outputs.PHPUNIT_SCHEMA_VERSION == '10.0' }} | |
| run: composer test-windows-phpunit10.0 |