Fix phpstan workflow file (#28741)

* Fix phpstan workflow file

# Fix phpstan workflow file

Line was split in two, joined

* qual: set memory limit to 'unlimited' (-1)

* Remove some stubs to check impact

* Fix: Verify execution time limit

* Remove stub files to reuse cache

* Qual: Rename distribution phpstan.neon to phpstan.neon.dist

# Qual: Rename distribution phpstan.neon to phpstan.neon.dist

This allows the developer to override some settings locally

Also update the .gitignore file with phpstan.neon and some other other
ignores (cache, local log files, temporary edit files).

* Enable debug on phpstan

* Re-enable stubs

* Fix: Change parallel settings to defaults, remove buffer

'buffer' is not a documented parameter, removing it.
Removing some configuration settings as the defaults are higher and
should adapt better to the target machine
This commit is contained in:
MDW 2024-03-11 14:04:02 +01:00 committed by GitHub
parent b72cf193c4
commit ec0fd31386
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 16 deletions

View File

@ -9,8 +9,7 @@ concurrency:
cancel-in-progress: true
env:
CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}',
github.base_ref, github.head_ref) || github.ref_name }}
CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@ -57,7 +56,8 @@ jobs:
# Run PHPStan
- name: Run PHPStan
id: phpstan
run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | tee _stan.xml | cs2pr --graceful-warnings
run: |
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
# continue-on-error: true
# Save cache

18
.gitignore vendored
View File

@ -66,8 +66,21 @@ doc/install.lock
/composer.json
/composer.lock
# to execute pre-commit
local.sh
# Local script, executed during pre-commit
/local.sh
# Local phpstan configuration
/phpstan.neon
/phpstan-baseline.neon
# Logs
/*.log
# Vim swap files
*.sw?
# Generated by PHPUNIT.BAT
/INI_PHPUNIT
# ignore cache builds
/build/phpstan/phpstan
@ -75,3 +88,4 @@ local.sh
phpstan_custom.neon
/.php-cs-fixer.cache
/.php_cs.cache
/.cache

View File

@ -1,11 +1,13 @@
parameters:
tmpDir: ./.github/tmp
parallel:
jobSize: 8
# Commented some of the settings, reminding the defaults:
# should adapt better to target machines
# jobSize: 8 # default is 20
processTimeout: 600.0
maximumNumberOfProcesses: 20
minimumNumberOfJobsPerProcess: 2
buffer: 134217728 # 128 MB
# maximumNumberOfProcesses: 20 # default is 32
# minimumNumberOfJobsPerProcess: 2 # default is 2
# buffer: 134217728 # 128 MB # Not documented
customRulesetUsed: true
level: 2
fileExtensions:
@ -13,13 +15,6 @@ parameters:
paths:
- htdocs
- scripts
stubFiles:
# - dev/tools/phan/stubs/GeoIP2.php
# - dev/tools/phan/stubs/geoip_inc.php
- dev/tools/phan/stubs/module_numberwords.php
- dev/tools/phan/stubs/restler.php
- dev/tools/phan/stubs/stripe.php
- dev/tools/phan/stubs/swiss-qr-bill.php
excludePaths:
analyseAndScan:
- htdocs/custom/*