php: Split phpstan tests into a separate workflow

This commit is contained in:
Sukhwinder Dhillon 2024-04-09 10:52:01 +02:00
parent 5e0d57cce0
commit 90e2be2348
4 changed files with 27 additions and 33 deletions

View file

@ -17,12 +17,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
os: ['ubuntu-latest']
steps:
- name: Checkout code base
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
@ -31,12 +31,7 @@ jobs:
tools: phpcs
- name: Setup dependencies
run: |
composer require -n --no-progress overtrue/phplint
git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2
git clone --depth 1 https://github.com/Icinga/icingadb-web.git vendor/icingadb-web
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty
run: composer require -n --no-progress overtrue/phplint
- name: PHP Lint
if: ${{ ! cancelled() }}
@ -45,7 +40,3 @@ jobs:
- name: PHP CodeSniffer
if: ${{ ! cancelled() }}
run: phpcs -wps --colors
- name: PHPStan
if: ${{ ! cancelled() }}
uses: php-actions/phpstan@v3

16
.github/workflows/phpstan.yml vendored Normal file
View file

@ -0,0 +1,16 @@
name: PHPStan
on:
pull_request:
branches:
- main
jobs:
phpstan:
uses: icinga/github-actions/.github/workflows/phpstan.yml@main
with:
dependencies: |
{
"/icingaweb2" : "https://github.com/Icinga/icingaweb2.git",
"/usr/share/icingaweb2-modules/icingadb" : "https://github.com/Icinga/icingadb-web.git"
}

View file

@ -45,11 +45,6 @@ parameters:
count: 1
path: application/controllers/GraphController.php
-
message: "#^Parameter \\#2 \\$checkCommand of method Icinga\\\\Module\\\\Graphite\\\\Controllers\\\\GraphController\\:\\:supplyImage\\(\\) expects string, mixed given\\.$#"
count: 2
path: application/controllers/GraphController.php
-
message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#"
count: 3
@ -385,6 +380,11 @@ parameters:
count: 1
path: library/Graphite/Graphing/MetricsQuery.php
-
message: "#^Parameter \\#2 \\$object of method Icinga\\\\Module\\\\Graphite\\\\Util\\\\IcingadbUtils\\:\\:resolveMacro\\(\\) expects Icinga\\\\Module\\\\Icingadb\\\\Compat\\\\CompatHost\\|Icinga\\\\Module\\\\Icingadb\\\\Compat\\\\CompatService\\|Icinga\\\\Module\\\\Icingadb\\\\Model\\\\Host\\|Icinga\\\\Module\\\\Icingadb\\\\Model\\\\Service, ipl\\\\Orm\\\\Model given\\.$#"
count: 1
path: library/Graphite/Graphing/MetricsQuery.php
-
message: "#^Call to an undefined method Icinga\\\\Data\\\\Fetchable\\:\\:where\\(\\)\\.$#"
count: 1
@ -705,21 +705,11 @@ parameters:
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
-
message: "#^Method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\:\\:getMonitoredObjectIdentifier\\(\\) should return string but returns mixed\\.$#"
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
-
message: "#^Method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\:\\:getObjectType\\(\\) has no return type specified\\.$#"
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
-
message: "#^Parameter \\#2 \\$value of method Icinga\\\\Web\\\\Url\\:\\:setParam\\(\\) expects array\\|bool\\|string, mixed given\\.$#"
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
-
message: "#^Cannot access property \\$name on mixed\\.$#"
count: 4
@ -745,11 +735,6 @@ parameters:
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
-
message: "#^Parameter \\#2 \\$value of method Icinga\\\\Web\\\\Url\\:\\:setParam\\(\\) expects array\\|bool\\|string, mixed given\\.$#"
count: 1
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
-
message: "#^Call to an undefined method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\|Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbService\\:\\:createServiceTitle\\(\\)\\.$#"
count: 1

View file

@ -13,7 +13,9 @@ parameters:
- library
scanDirectories:
- vendor
- /icingaweb2
- /usr/share/icinga-php
- /usr/share/icingaweb2-modules
ignoreErrors:
-