From 557149c24173aea1780d655d3bd2aa69fe921b5b Mon Sep 17 00:00:00 2001 From: Niels Braczek Date: Mon, 15 Aug 2022 14:58:10 +0200 Subject: [PATCH] Enable CI for PHP 8.2 --- .drone.jsonnet | 4 +- .drone.yml | 147 ++++++++++++++++++++++++++++++------------------- composer.json | 4 +- ruleset.xml | 25 +++++++++ 4 files changed, 118 insertions(+), 62 deletions(-) create mode 100644 ruleset.xml diff --git a/.drone.jsonnet b/.drone.jsonnet index 2799da7f..dda8cfc4 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -25,7 +25,7 @@ local composer(phpversion, params) = { local phpunit(phpversion) = { name: "PHPUnit", image: "joomlaprojects/docker-images:php" + phpversion, - [if phpversion == "8.0" then "failure"]: "ignore", + [if phpversion == "8.2" then "failure"]: "ignore", commands: ["vendor/bin/phpunit"] }; @@ -61,7 +61,7 @@ local pipeline(name, phpversion, params) = { depends: [ "composer" ], commands: [ "vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards", - "vendor/bin/phpcs -p --report=full --extensions=php --standard=Joomla src/" + "vendor/bin/phpcs --standard=ruleset.xml src/" ] }, { diff --git a/.drone.yml b/.drone.yml index 229701ed..367c6559 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,63 +1,94 @@ --- -kind: pipeline -name: Codequality - -platform: - os: linux - arch: amd64 - -steps: -- name: composer - image: joomlaprojects/docker-images:php7.4 - commands: - - php -v - - composer update - - composer require phpmd/phpmd phpstan/phpstan - volumes: - - name: composer-cache - path: /tmp/composer-cache - -- name: phpcs - image: joomlaprojects/docker-images:php7.4 - commands: - - vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards - - vendor/bin/phpcs -p --report=full --extensions=php --standard=Joomla src/ - -- name: phpmd - image: joomlaprojects/docker-images:php7.4 - commands: - - vendor/bin/phpmd src text cleancode - - vendor/bin/phpmd src text codesize - - vendor/bin/phpmd src text controversial - - vendor/bin/phpmd src text design - - vendor/bin/phpmd src text unusedcode - failure: ignore - -- name: phpstan - image: joomlaprojects/docker-images:php7.4 - commands: - - vendor/bin/phpstan analyse src - failure: ignore - -- name: phploc - image: joomlaprojects/docker-images:php7.4 - commands: - - phploc src - failure: ignore - -- name: phpcpd - image: joomlaprojects/docker-images:php7.4 - commands: - - phpcpd src - failure: ignore - -volumes: -- name: composer-cache - host: - path: /tmp/composer-cache - +{ + "kind": "pipeline", + "name": "Codequality", + "steps": [ + { + "commands": [ + "php -v", + "composer update", + "composer require phpmd/phpmd phpstan/phpstan" + ], + "image": "joomlaprojects/docker-images:php7.4", + "name": "composer", + "volumes": [ + { + "name": "composer-cache", + "path": "/tmp/composer-cache" + } + ] + }, + { + "commands": [ + "vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards", + "vendor/bin/phpcs --standard=ruleset.xml src/" + ], + "depends": [ + "composer" + ], + "image": "joomlaprojects/docker-images:php7.4", + "name": "phpcs" + }, + { + "commands": [ + "vendor/bin/phpmd src text cleancode", + "vendor/bin/phpmd src text codesize", + "vendor/bin/phpmd src text controversial", + "vendor/bin/phpmd src text design", + "vendor/bin/phpmd src text unusedcode" + ], + "depends": [ + "composer" + ], + "failure": "ignore", + "image": "joomlaprojects/docker-images:php7.4", + "name": "phpmd" + }, + { + "commands": [ + "vendor/bin/phpstan analyse src" + ], + "depends": [ + "composer" + ], + "failure": "ignore", + "image": "joomlaprojects/docker-images:php7.4", + "name": "phpstan" + }, + { + "commands": [ + "phploc src" + ], + "depends": [ + "composer" + ], + "failure": "ignore", + "image": "joomlaprojects/docker-images:php7.4", + "name": "phploc" + }, + { + "commands": [ + "phpcpd src" + ], + "depends": [ + "composer" + ], + "failure": "ignore", + "image": "joomlaprojects/docker-images:php7.4", + "name": "phpcpd" + } + ], + "volumes": [ + { + "host": { + "path": "/tmp/composer-cache" + }, + "name": "composer-cache" + } + ] +} --- kind: signature -hmac: 6cfd57c6b17dcd18db698e3ffbde6a41dc0ebb254efba16864c1fa9e80524e94 +hmac: 6ead9ff74e03f8c82d6613cad3a6e8b2f07e2cfc46017937172f7f0266390a22 ... diff --git a/composer.json b/composer.json index c60092a0..e2f9cbf9 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,11 @@ "homepage": "https://github.com/joomla-framework/test", "license": "GPL-2.0-or-later", "require": { - "php": "^7.2.5|^8.0" + "php": "^7.2.5|~8.0.0|~8.1.0" }, "require-dev": { "joomla/coding-standards": "~3.0@dev", - "joomla/database": "~2.0", + "joomla/database": "^2.0", "phpunit/phpunit": "^8.5|^9.0" }, "conflict": { diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 00000000..832ac7e3 --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + */.github/* + + + */vendor/* + + + + + + + + + + +