From 1c864804d75c29d9750148747ec5cbaa0519e462 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Thu, 5 Nov 2026 23:49:44 +0000 Subject: [PATCH 1/3] Test PHP 8.5 and 8.6 in CI Amp-Thread-ID: https://ampcode.com/threads/T-01a1ae1c-fdbe-75e4-85a8-81dd8ccd3b49 --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 12cfd9a..28520e3 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.0, 7.4] + php: ['8.6', '8.5', '8.1', '8.0', '7.4'] dependency-version: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} From 96fc04afbb951435bfa620d028de2f9a67b9f77c Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 6 Nov 2026 13:27:31 +0000 Subject: [PATCH 2/3] Require PHP 8.4+ and test on PHP 8.4, 8.5 and 8.6 Drop support for PHP 8.3 and below, require spatie/macroable ^2.0 and symfony/process ^7.0|^8.0, move the test suite to Pest 4/5, and migrate phpunit.xml.dist to the PHPUnit 12+ schema. Amp-Thread-ID: https://ampcode.com/threads/T-01a1b108-3a10-7322-b0a3-50cbb7a670c5 --- .github/workflows/run-tests.yml | 4 ++-- composer.json | 13 ++++++------- phpunit.xml.dist | 25 ++++++------------------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 28520e3..269e00c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: ['8.6', '8.5', '8.1', '8.0', '7.4'] + php: ['8.6', '8.5', '8.4'] dependency-version: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -37,7 +37,7 @@ jobs: coverage: none - name: Install dependencies - run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - name: Execute tests run: vendor/bin/pest diff --git a/composer.json b/composer.json index 3a65cf4..e5dfeef 100644 --- a/composer.json +++ b/composer.json @@ -22,15 +22,14 @@ } ], "require": { - "php": "^7.4|^8.0", - "spatie/macroable": "^1.0|^2.0", - "symfony/process": "^5.3|^6.0|^7.0|^8.0" + "php": "^8.4", + "spatie/macroable": "^2.0", + "symfony/process": "^7.0|^8.0" }, "require-dev": { - "pestphp/pest": "^1.22", - "phpunit/phpunit": "^9.4", - "spatie/ssh": "^1.7.0", - "symfony/var-dumper": "^5.3|^6.0|^7.0|^8.0" + "pestphp/pest": "^4.0|^5.0", + "spatie/ssh": "^1.13.2", + "symfony/var-dumper": "^7.0|^8.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fb4a656..7093e2f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,32 +1,19 @@ - - - src/ - - - - - - - tests - - - + + + src + + From 53a9dc534ce01dc7e7e24aeb1c792c0948251669 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 6 Nov 2026 13:29:37 +0000 Subject: [PATCH 3/3] Wait for test containers to be removed between feature tests Amp-Thread-ID: https://ampcode.com/threads/T-01a1b108-3a10-7322-b0a3-50cbb7a670c5 --- tests/FeatureTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/FeatureTest.php b/tests/FeatureTest.php index 46fc60e..5617a34 100644 --- a/tests/FeatureTest.php +++ b/tests/FeatureTest.php @@ -15,6 +15,22 @@ ->usePrivateKey(__DIR__.'/keys/spatie_docker_package_id_rsa'); }); +afterEach(function () { + // Containers started with --rm are removed asynchronously after they stop, + // so wait until the name is free before the next test reuses it. + for ($attempt = 0; $attempt < 100; $attempt++) { + exec('docker inspect spatie_docker_test > /dev/null 2>&1', $output, $exitCode); + + if ($exitCode !== 0) { + return; + } + + exec('docker rm -f spatie_docker_test > /dev/null 2>&1'); + + usleep(100_000); + } +}); + it('can start a container', function () { $container = $this->container->start();