From a3932a478dab2d7c38e65d91d185c6a86b32cc66 Mon Sep 17 00:00:00 2001 From: Niels Braczek Date: Mon, 15 Aug 2022 15:44:22 +0200 Subject: [PATCH] Enable CI for PHP 8.2 --- .drone.jsonnet | 6 ++++-- .drone.yml | 41 +++++++++++++++++++++++++++++++++++++-- composer.json | 4 ++-- ruleset.xml | 28 ++++++++++++-------------- tests/FactoryTest.php | 1 + tests/Format/IniTest.php | 1 + tests/Format/JsonTest.php | 1 + tests/Format/PhpTest.php | 1 + tests/Format/XmlTest.php | 1 + tests/Format/YamlTest.php | 1 + tests/RegistryTest.php | 4 ++-- tests/Stubs/Ini.php | 1 + tests/Stubs/jregistry.php | 4 +++- 13 files changed, 69 insertions(+), 25 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 59ac8a94..8162a08b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -25,6 +25,7 @@ local composer(phpversion, params) = { local phpunit(phpversion) = { name: "PHPUnit", image: "joomlaprojects/docker-images:php" + phpversion, + [if phpversion == "8.2" then "failure"]: "ignore", commands: ["vendor/bin/phpunit"] }; @@ -59,7 +60,7 @@ local pipeline(name, phpversion, params) = { image: "joomlaprojects/docker-images:php7.4", depends: [ "composer" ], commands: [ - "vendor/bin/phpcs -p --report=full --extensions=php --standard=PSR12 src/" + "vendor/bin/phpcs --standard=ruleset.xml" ] }, { @@ -109,5 +110,6 @@ local pipeline(name, phpversion, params) = { pipeline("7.3", "7.3", "--prefer-stable"), pipeline("7.4", "7.4", "--prefer-stable"), pipeline("8.0", "8.0", "--prefer-stable"), - pipeline("8.1", "8.1", "--prefer-stable") + pipeline("8.1", "8.1", "--prefer-stable"), + pipeline("8.2", "8.2", "--prefer-stable --ignore-platform-reqs"), ] diff --git a/.drone.yml b/.drone.yml index 8fff44f4..c169eea3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,7 +20,7 @@ }, { "commands": [ - "vendor/bin/phpcs -p --report=full --extensions=php --standard=PSR12 src/" + "vendor/bin/phpcs --standard=ruleset.xml" ], "depends": [ "composer" @@ -303,7 +303,44 @@ ] } --- +{ + "kind": "pipeline", + "name": "PHP 8.2", + "steps": [ + { + "commands": [ + "php -v", + "composer update --prefer-stable --ignore-platform-reqs" + ], + "image": "joomlaprojects/docker-images:php8.2", + "name": "composer", + "volumes": [ + { + "name": "composer-cache", + "path": "/tmp/composer-cache" + } + ] + }, + { + "commands": [ + "vendor/bin/phpunit" + ], + "failure": "ignore", + "image": "joomlaprojects/docker-images:php8.2", + "name": "PHPUnit" + } + ], + "volumes": [ + { + "host": { + "path": "/tmp/composer-cache" + }, + "name": "composer-cache" + } + ] +} +--- kind: signature -hmac: 8ce225386480f94a8ed0cfbb8261489d0bb53a674f4264f92eadfcea27b40ccc +hmac: adf77e27d980fe75d12a8a5c07da2e0db889d914d4bbf7444b03f4efdd4c0c5e ... diff --git a/composer.json b/composer.json index 9e972fb9..beaa13b4 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "homepage": "https://github.com/joomla-framework/registry", "license": "GPL-2.0-or-later", "require": { - "php": "^7.2.5|^8.0", - "joomla/utilities": "^1.4.1|^2.0" + "php": "^7.2.5|~8.0.0|~8.1.0", + "joomla/utilities": "^2.0" }, "require-dev": { "joomla/coding-standards": "^3.0@dev", diff --git a/ruleset.xml b/ruleset.xml index 832ac7e3..87489117 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -1,25 +1,21 @@ - + + + This is a PSR-12 compliant ruleset for Joomla. + + src + tests + + - + - - */.github/* - - - */vendor/* - - - - - - - - - + + + diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index 3cba9ab5..03fc2042 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -1,4 +1,5 @@ 'testtoarray2', 'config' => ['foo3' => 'testtoarray3'], ], - (new Registry(['foo1' => 'testtoarray1', 'foo2' => 'testtoarray2', 'config' => ['foo3' => 'testtoarray3']] - ))->toArray(), + (new Registry(['foo1' => 'testtoarray1', 'foo2' => 'testtoarray2', 'config' => ['foo3' => 'testtoarray3']]))->toArray(), 'The Registry should be converted to an array.' ); } diff --git a/tests/Stubs/Ini.php b/tests/Stubs/Ini.php index e1cb67ef..c760f05b 100644 --- a/tests/Stubs/Ini.php +++ b/tests/Stubs/Ini.php @@ -1,4 +1,5 @@