Skip to content

Commit

Permalink
Fix phpstan workflow file (#28741)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mdeweerd authored Mar 11, 2024
1 parent b72cf19 commit ec0fd31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,26 @@ 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
/build/phpstan/bootstrap_custom.php
phpstan_custom.neon
/.php-cs-fixer.cache
/.php_cs.cache
/.cache
17 changes: 6 additions & 11 deletions phpstan.neon → phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
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:
- php
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/*
Expand Down

0 comments on commit ec0fd31

Please sign in to comment.