Add Static Analysis to CI (#9262)

This commit is contained in:
Michael Voříšek
2023-12-17 09:45:46 +01:00
committed by GitHub
parent 93946f4ca7
commit a4e160a1c1
4 changed files with 3324 additions and 0 deletions

View File

@@ -39,3 +39,35 @@ jobs:
- name: Check composer.json format
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock
phpstan:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
name: Static Analysis
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring
tools: composer:v2
coverage: none
ini-values: error_reporting=E_ALL
- name: Setup composer
run: |
cp composer.json-dist composer.json
composer require "kolab/net_ldap3:~1.1.1" --no-update
composer require "laravel/dusk:^7.9" --no-update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Run Static Analysis
run: |
vendor/bin/phpstan analyse

View File

@@ -19,6 +19,9 @@
"require-dev": {
"ergebnis/composer-normalize": "^2.13",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.2",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpunit/phpunit": "^9.6"
},
"suggest": {
@@ -34,6 +37,7 @@
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true,
"roundcube/plugin-installer": true
}
}

3279
phpstan-baseline.neon Normal file

File diff suppressed because it is too large Load Diff

9
phpstan.neon.dist Normal file
View File

@@ -0,0 +1,9 @@
includes:
- phpstan-baseline.neon
parameters:
level: 2
paths:
- .
excludePaths:
- vendor