diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 12cfd9a..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.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 + + 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();