From eff7abc71b94dca9c32f8179d0fb7e087d4cd0b5 Mon Sep 17 00:00:00 2001 From: Li Zhineng Date: Mon, 25 Aug 2025 11:39:20 +0800 Subject: [PATCH 1/3] fix with quotes --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cb2e33..966521f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: ${{ startsWith(github.ref, 'refs/tags/v') && 0 || 1 }} + fetch-depth: ${{ startsWith(github.ref, 'refs/tags/v') && '0' || '1' }} - name: Retrieve the previous release version if: startsWith(github.ref, 'refs/tags/v') From 47ab852ddc630629a4b5718b38400952d6058012 Mon Sep 17 00:00:00 2001 From: Li Zhineng Date: Mon, 25 Aug 2025 11:46:37 +0800 Subject: [PATCH 2/3] fix registry name --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 78bf82d..5e21a36 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ build-%: BUILD_ARGS="$(shell awk '/^[a-zA-Z0-9]+ *=/ { printf "--build-arg %s_VERSION=%s ", toupper($$1), $$3 }' "$*/dependencies.ini" | xargs)" && \ docker buildx build $$BUILD_ARGS $(DOCKER_BUILD_EXTRA) \ --load \ - -t $(DOCKER_BUILD_EXTRA)/$(DOCKER_IMAGE):$(subst php,,$*) \ + -t $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(subst php,,$*) \ . build: $(addprefix build-,$(VARIANTS)) From 1df82fdcd80ec16978b1730d711b1a86f76c0224 Mon Sep 17 00:00:00 2001 From: Li Zhineng Date: Mon, 25 Aug 2025 12:17:48 +0800 Subject: [PATCH 3/3] fix test command --- Makefile | 5 ++++- tests/phpunit.xml.dist | 2 ++ tests/tests/FeatureTest.php | 13 ++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5e21a36..be76c51 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,10 @@ test-setup: test-%: cd tests; \ - DEW_PHP_VERSION="$*" composer run test + DEW_PHP_VERSION="$*" \ + DOCKER_REGISTRY="$(DOCKER_REGISTRY)" \ + DOCKER_IMAGE="$(DOCKER_IMAGE)" \ + composer run test test: test-setup $(addprefix test-,$(VARIANTS)) diff --git a/tests/phpunit.xml.dist b/tests/phpunit.xml.dist index f007967..a7636c7 100644 --- a/tests/phpunit.xml.dist +++ b/tests/phpunit.xml.dist @@ -18,5 +18,7 @@ + + diff --git a/tests/tests/FeatureTest.php b/tests/tests/FeatureTest.php index 41765a7..8cdf121 100644 --- a/tests/tests/FeatureTest.php +++ b/tests/tests/FeatureTest.php @@ -31,13 +31,24 @@ private function execute(string $command): array $exit = null; $version = $_ENV['DEW_PHP_VERSION']; + $registry = $_ENV['DOCKER_REGISTRY']; + $image = $_ENV['DOCKER_IMAGE']; if ($version === '') { $this->markTestSkipped('The environment variable "DEW_PHP_VERSION" is missing.'); } + if ($registry === '') { + $this->markTestSkipped('The environment variable "DOCKER_REGISTRY" is missing.'); + } + + if ($image === '') { + $this->markTestSkipped('The environment variable "DOCKER_IMAGE" is missing.'); + } + + $tag = str_replace('php', '', $version); $cmd = preg_replace( - '/^php /', "docker run --rm dew/{$version} ", $command + '/^php /', sprintf('docker run --rm %s/%s:%s ', $registry, $image, $tag), $command ); exec($cmd, $output, $exit);