diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83ddbec786..9bd0f70983 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ concurrency: jobs: tests: - name: "Tests" + name: "Tests PHPUnit 12.x" runs-on: ${{ matrix.operating-system }} timeout-minutes: 60 @@ -32,12 +32,49 @@ jobs: fail-fast: false matrix: php-version: - - "8.2" - "8.3" - "8.4" - "8.5" operating-system: [ ubuntu-latest, windows-latest ] + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: pecl + extensions: ds,mbstring + ini-file: development + ini-values: memory_limit=-1 + + - name: "Upgrade PHPUnit 12" + shell: bash + run: | + composer require --dev phpunit/phpunit:^12 brianium/paratest:^7.16 symfony/process:^7 symfony/string:^7 symfony/console:^7 --update-with-dependencies --ignore-platform-reqs --working-dir=tests + composer require --dev phpunit/phpunit:^12 sebastian/diff --update-with-dependencies --ignore-platform-reqs + + - name: "Check PHP configuration" + run: "vendor/bin/phpunit --check-php-configuration" + + - name: "Tests" + run: "php tests/vendor/bin/paratest --runner WrapperRunner --no-coverage" + + tests-phpunit11: + name: "Tests PHPUnit 11.x" + runs-on: ${{ matrix.operating-system }} + timeout-minutes: 60 + + strategy: + fail-fast: false + matrix: + php-version: + - "8.2" + operating-system: [ ubuntu-latest, windows-latest ] + steps: - name: "Checkout" uses: actions/checkout@v4 @@ -208,7 +245,6 @@ jobs: fail-fast: false matrix: php-version: - - "8.2" - "8.3" - "8.4" operating-system: [ubuntu-latest] @@ -227,7 +263,7 @@ jobs: - uses: ./build-infection/.github/actions/setup-php with: php-version: "${{ matrix.php-version }}" - extensions: ds,mbstring + php-extensions: ds,mbstring - uses: "ramsey/composer-install@v3" @@ -235,6 +271,12 @@ jobs: with: working-directory: "tests/" + - name: "Upgrade PHPUnit with Paratest to speedup coverage generation" + shell: bash + run: | + composer require --dev phpunit/phpunit:^12 brianium/paratest:^7.16 symfony/process:^7 symfony/string:^7 symfony/console:^7 --update-with-dependencies --ignore-platform-reqs --working-dir=tests + composer require --dev phpunit/phpunit:^12 sebastian/diff --update-with-dependencies --ignore-platform-reqs + - uses: "ramsey/composer-install@v3" with: working-directory: "build-infection/" @@ -266,6 +308,7 @@ jobs: php -d pcov.enabled=1 tests/vendor/bin/paratest \ --passthru-php="'-d' 'pcov.enabled=1'" \ --coverage-xml=tmp/coverage/coverage-xml --log-junit=tmp/coverage/junit.xml + --exclude-source-from-xml-coverage - name: "Run infection" run: | diff --git a/composer.json b/composer.json index 6ba8e04289..491e205e88 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "react/promise": "^3.2", "react/socket": "^1.3", "react/stream": "^1.1", - "sebastian/diff": "^6.0.2", + "sebastian/diff": "^6.0.2 || ^7", "symfony/console": "^5.4.3", "symfony/finder": "^5.4.3", "symfony/polyfill-intl-grapheme": "^1.23", diff --git a/composer.lock b/composer.lock index 8309df4662..661b45a80a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f6988e269ffb0526d70d88c50dd488e0", + "content-hash": "3d919d524c799e26f9f7a91232600138", "packages": [ { "name": "clue/ndjson-react", @@ -4936,16 +4936,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.10", + "version": "2.0.x-dev", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "8d61a5854e7497d95bc85188e13537e99bd7aae7" + "reference": "033f6906f7abc5acbe3c81b642ad9e363e1bb4a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/8d61a5854e7497d95bc85188e13537e99bd7aae7", - "reference": "8d61a5854e7497d95bc85188e13537e99bd7aae7", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/033f6906f7abc5acbe3c81b642ad9e363e1bb4a0", + "reference": "033f6906f7abc5acbe3c81b642ad9e363e1bb4a0", "shasum": "" }, "require": { @@ -4962,6 +4962,7 @@ "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^9.6" }, + "default-branch": true, "type": "phpstan-extension", "extra": { "phpstan": { @@ -4983,9 +4984,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.10" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.x" }, - "time": "2025-12-06T11:15:39+00:00" + "time": "2025-10-29T08:37:09+00:00" }, { "name": "phpstan/phpstan-strict-rules", diff --git a/phpunit.xml b/phpunit.xml index 8caf6bb5e6..7e84631214 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - +