Skip to content

Commit

Permalink
CI: Introduce PHP compatibility check (#7844)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirone authored Jan 9, 2025
1 parent ea13be1 commit 6c5c0b9
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 133 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/sca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
- name: Check - phpstan
run: ./dev-tools/vendor/bin/phpstan analyse --ansi

- name: Check - PHP compatibility
run: composer php-compatibility

- name: Check - composer-unused
run: ./dev-tools/vendor/bin/composer-unused --no-progress --excludePackage=composer/xdebug-handler

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/composer.lock
/dev-tools/bin/
/dev-tools/infection/
/dev-tools/php-compatibility/cache.json
/dev-tools/phpstan/cache/
/dev-tools/vendor/
/infection.json5
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"@composer normalize --working-dir=dev-tools ../composer.json",
"@composer normalize --working-dir=dev-tools composer.json"
],
"php-compatibility": "@php dev-tools/vendor/bin/phpcs -p --standard=dev-tools/php-compatibility/phpcs-php-compatibility.xml",
"phpstan": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse",
"phpstan:baseline": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse --generate-baseline=./dev-tools/phpstan/baseline.php",
"qa": "@quality-assurance",
Expand Down Expand Up @@ -185,6 +186,7 @@
"mess-detector": "Analyse code with Mess Detector",
"normalize": "Check normalization for composer.json files",
"normalize:fix": "Run normalization for composer.json files",
"php-compatibility": "Check compatibility with all supported PHP versions",
"phpstan": "Run PHPStan analysis",
"phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible",
"post-autoload-dump": "Run additional tasks after installing/updating main dependencies",
Expand Down
3 changes: 3 additions & 0 deletions dev-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"kubawerlos/composer-smaller-lock": "^1.0.1",
"maglnet/composer-require-checker": "^4.14.0",
"mi-schi/phpmd-extension": "^4.3.0",
"phpcompatibility/php-compatibility": "10.x-dev as 9.99.0",
"phpcompatibility/phpcompatibility-symfony": "^1.2",
"phpmd/phpmd": "^2.15.0",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.1",
Expand All @@ -16,6 +18,7 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"infection/extension-installer": false,
"kubawerlos/composer-smaller-lock": true,
Expand Down
Loading

0 comments on commit 6c5c0b9

Please sign in to comment.