Skip to content

Commit 90e2be2

Browse files
php: Split phpstan tests into a separate workflow
1 parent 5e0d57c commit 90e2be2

File tree

4 files changed

+27
-33
lines changed

4 files changed

+27
-33
lines changed

.github/workflows/php.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
20+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
2121
os: ['ubuntu-latest']
2222

2323
steps:
2424
- name: Checkout code base
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2
@@ -31,12 +31,7 @@ jobs:
3131
tools: phpcs
3232

3333
- name: Setup dependencies
34-
run: |
35-
composer require -n --no-progress overtrue/phplint
36-
git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2
37-
git clone --depth 1 https://github.com/Icinga/icingadb-web.git vendor/icingadb-web
38-
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library
39-
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty
34+
run: composer require -n --no-progress overtrue/phplint
4035

4136
- name: PHP Lint
4237
if: ${{ ! cancelled() }}
@@ -45,7 +40,3 @@ jobs:
4540
- name: PHP CodeSniffer
4641
if: ${{ ! cancelled() }}
4742
run: phpcs -wps --colors
48-
49-
- name: PHPStan
50-
if: ${{ ! cancelled() }}
51-
uses: php-actions/phpstan@v3

.github/workflows/phpstan.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: PHPStan
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
phpstan:
10+
uses: icinga/github-actions/.github/workflows/phpstan.yml@main
11+
with:
12+
dependencies: |
13+
{
14+
"/icingaweb2" : "https://github.com/Icinga/icingaweb2.git",
15+
"/usr/share/icingaweb2-modules/icingadb" : "https://github.com/Icinga/icingadb-web.git"
16+
}

phpstan-baseline.neon

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ parameters:
4545
count: 1
4646
path: application/controllers/GraphController.php
4747

48-
-
49-
message: "#^Parameter \\#2 \\$checkCommand of method Icinga\\\\Module\\\\Graphite\\\\Controllers\\\\GraphController\\:\\:supplyImage\\(\\) expects string, mixed given\\.$#"
50-
count: 2
51-
path: application/controllers/GraphController.php
52-
5348
-
5449
message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#"
5550
count: 3
@@ -385,6 +380,11 @@ parameters:
385380
count: 1
386381
path: library/Graphite/Graphing/MetricsQuery.php
387382

383+
-
384+
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\\.$#"
385+
count: 1
386+
path: library/Graphite/Graphing/MetricsQuery.php
387+
388388
-
389389
message: "#^Call to an undefined method Icinga\\\\Data\\\\Fetchable\\:\\:where\\(\\)\\.$#"
390390
count: 1
@@ -705,21 +705,11 @@ parameters:
705705
count: 1
706706
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
707707

708-
-
709-
message: "#^Method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\:\\:getMonitoredObjectIdentifier\\(\\) should return string but returns mixed\\.$#"
710-
count: 1
711-
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
712-
713708
-
714709
message: "#^Method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\:\\:getObjectType\\(\\) has no return type specified\\.$#"
715710
count: 1
716711
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
717712

718-
-
719-
message: "#^Parameter \\#2 \\$value of method Icinga\\\\Web\\\\Url\\:\\:setParam\\(\\) expects array\\|bool\\|string, mixed given\\.$#"
720-
count: 1
721-
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
722-
723713
-
724714
message: "#^Cannot access property \\$name on mixed\\.$#"
725715
count: 4
@@ -745,11 +735,6 @@ parameters:
745735
count: 1
746736
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
747737

748-
-
749-
message: "#^Parameter \\#2 \\$value of method Icinga\\\\Web\\\\Url\\:\\:setParam\\(\\) expects array\\|bool\\|string, mixed given\\.$#"
750-
count: 1
751-
path: library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
752-
753738
-
754739
message: "#^Call to an undefined method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbHost\\|Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\Graphs\\\\Icingadb\\\\IcingadbService\\:\\:createServiceTitle\\(\\)\\.$#"
755740
count: 1

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ parameters:
1313
- library
1414

1515
scanDirectories:
16-
- vendor
16+
- /icingaweb2
17+
- /usr/share/icinga-php
18+
- /usr/share/icingaweb2-modules
1719

1820
ignoreErrors:
1921
-

0 commit comments

Comments
 (0)