diff --git a/.dagger/composer.json b/.dagger/composer.json index d29f850..9bb9e1b 100644 --- a/.dagger/composer.json +++ b/.dagger/composer.json @@ -13,17 +13,12 @@ } ], "require": { - "php": "^8.1", + "php": "^8.4", "dagger/dagger": "*@dev" }, "autoload": { "psr-4": { "DaggerModule\\": "src/" } - }, - "config": { - "platform": { - "php": "8.3.7" - } } } diff --git a/.dagger/src/PhpProject.php b/.dagger/src/PhpProject.php index 17f8744..7795c82 100644 --- a/.dagger/src/PhpProject.php +++ b/.dagger/src/PhpProject.php @@ -20,6 +20,27 @@ #[Doc("PHP Code Quality functions")] class PhpProject { + /** + * Create a PHP container using the specified image and variant. + * + * This method constructs a container from the given PHP image name and + * variant. By default, it uses the "php:8.5-cli" image. It does not perform + * any automatic PHP version detection or caching. + * + * @param string $image The base PHP image name (default: "php") + * @param string $variant The PHP image variant tag (default: "8.5-cli") + * @return Container A container based on the specified PHP image + */ + private function php( + string $image = "php", + string $variant = "8.5-cli", + ): Container { + return dag() + ->container() + ->from("{$image}:{$variant}") + ; + } + /** * Allows to install vendors with * @@ -48,9 +69,7 @@ public function checkCodingStandards( #[DefaultPath("."), Ignore("**/vendor", "docs")] Directory $source ): Container { - return dag() - ->container() - ->from("php:8.3-cli") + return $this->php() ->withMountedDirectory("/app", $source) ->withDirectory("/app/vendor", $this->vendors($source)) ->withWorkdir("/app") @@ -74,9 +93,7 @@ public function test( $phpunit[] = "--testsuite={$testSuite}"; } - return dag() - ->container() - ->from("php:8.3-cli") + return $this->php() ->withMountedDirectory("/app", $source) ->withDirectory("/app/vendor", $this->vendors($source)) ->withWorkdir("/app") diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 45ea442..7dc9ece 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -3,6 +3,8 @@ on: push: branches: - main + pull_request: + branches: [ "main" ] jobs: coding-standards: @@ -34,7 +36,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Check for coding-standards + - name: Run tests uses: dagger/dagger-for-github@8.0.0 with: version: "latest" diff --git a/composer.json b/composer.json index 9ebb7e6..aea9a3b 100644 --- a/composer.json +++ b/composer.json @@ -14,19 +14,20 @@ } }, "require": { - "php": "^8.3" + "php": "^8.5" }, "require-dev": { "ext-dom": "*", - "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^2.1", - "phpunit/phpunit": "^12.1", - "symplify/easy-coding-standard": "^12" + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.38", + "phpunit/phpunit": "^12.5.8", + "symplify/easy-coding-standard": "^12.6.2" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, + "bump-after-update": true, "allow-plugins": { "phpstan/extension-installer": true }