11name : PHPStan
22
3+ permissions :
4+ contents : read
5+
36on :
47 push :
5- branches :
6- - " *"
78 pull_request :
8- branches : [ 'master', 'main' ]
9- pull_request_target :
10- types :
11- - closed
129
1310jobs :
1411 run :
@@ -19,17 +16,16 @@ jobs:
1916 level : [ 1, 2 ]
2017 include :
2118 - current-level : 1
22- - max-level : 2
2319 steps :
2420 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2521
2622 - name : Setup PHP
27- uses : shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
23+ uses : shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
2824 with :
2925 php-version : ' 8.4'
3026
31- - name : Remove phpDocumentor temporarily and Install PHPStan
32- run : composer remove --dev --no-update phpdocumentor/phpdocumentor; composer update
27+ - name : Install PHPStan
28+ run : composer install
3329
3430 - name : Restore cached baseline for PHPStan
3531 id : cache-baseline-restore
@@ -42,30 +38,13 @@ jobs:
4238 phpstan-baseline-
4339
4440 - name : Run PHPStan
45- if : matrix.level == matrix.current-level
46- continue-on-error : true
41+ if : matrix.level < matrix.current-level || matrix.level == matrix.current-level
4742 run : |
48- ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
43+ ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
4944
5045 - name : Run PHPStan
5146 if : matrix.level > matrix.current-level
5247 continue-on-error : true
5348 run : |
54- ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
55- exit 0
56-
57- - name : Generate the baseline for PHPStan
58- if : matrix.level == matrix.max-level && github.event.pull_request.merged == true
59- continue-on-error : true
60- run : |
61- ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon --generate-baseline test/phpstan-baseline.neon src test -vvv --debug -l "${{ matrix.level }}"
62- exit 0
63-
64- - name : Save the baseline for PHPStan
65- id : cache-baseline-save
66- if : matrix.level == matrix.max-level && github.event.pull_request.merged == true
67- uses : actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
68- with :
69- path : |
70- test/phpstan-baseline.neon
71- key : phpstan-baseline-${{ github.run_id }}"
49+ ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
50+ exit 0
0 commit comments