Skip to content

Commit

Permalink
Enable CI for PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nibra committed Aug 15, 2022
1 parent 6cfc4c9 commit 557149c
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
};

Expand Down Expand Up @@ -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/"
]
},
{
Expand Down
147 changes: 89 additions & 58 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -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

...
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
25 changes: 25 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<ruleset name="Joomla">

<arg name="report" value="full"/>
<arg name="tab-width" value="4"/>
<arg name="encoding" value="utf-8"/>
<arg value="sp"/>
<arg name="colors" />

<!-- Exclude folders not containing production code -->
<exclude-pattern>*/.github/*</exclude-pattern>

<!-- Exclude 3rd party libraries. -->
<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="Joomla">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
</rule>

<rule ref="Joomla.Classes.InstantiateNewClasses">
<properties>
<property name="shortArraySyntax" value="true"/>
</properties>
</rule>
</ruleset>

0 comments on commit 557149c

Please sign in to comment.