99jobs :
1010 phpstan :
1111 runs-on : ubuntu-latest
12+ # define every php version to test
13+ strategy :
14+ # do not stop at first fail
15+ fail-fast : false
16+ matrix :
17+ php : [7.4, 8.2]
18+
1219 steps :
1320 - uses : actions/checkout@v4
1421
15- - name : Setup PHP 7.4 for dependencies
22+ - name : Setup PHP ${{ matrix.php }} for dependencies
1623 uses : shivammathur/setup-php@v2
1724 with :
18- php-version : 7.4
25+ php-version : ${{ matrix.php }}
1926
2027 - name : Install Dependencies
2128 run : composer update --ignore-platform-reqs
2229
23- - name : Setup PHP 8.2 for PHPStan
24- uses : shivammathur/setup-php@v2
25- with :
26- php-version : 8.2
27-
2830 - name : Restore PHPStan cache
2931 id : cache-phpstan
3032 uses : actions/cache/restore@v3
3133 with :
3234 path : phpstan.phar
3335 key : phpstan-1
3436
35- - name : Download PHPStan
36- if : steps.cache-phpstan.outputs.cache-hit != 'true'
37- run : wget https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
38-
3937 - name : Run PHPStan
40- run : php phpstan.phar analyse --configuration phpstan.neon
38+ run : vendor/bin/ phpstan analyse --configuration phpstan.neon
4139
4240 update-baseline :
4341 needs : phpstan
5048
5149 - name : Delete existing branch if exists
5250 run : |
53- if git ls-remote --heads origin update-phpstan-baseline | grep update-phpstan-baseline; then
54- git push origin --delete update-phpstan-baseline
55- fi
51+ git ls-remote --exit-code --heads origin update-phpstan-baseline && git push origin --delete update-phpstan-baseline
5652
5753 - name : Setup PHP 7.4 for dependencies
5854 uses : shivammathur/setup-php@v2
@@ -62,19 +58,11 @@ jobs:
6258 - name : Install Dependencies
6359 run : composer update --ignore-platform-reqs
6460
65- - name : Setup PHP 8.2 for PHPStan
66- uses : shivammathur/setup-php@v2
67- with :
68- php-version : 8.2
69-
70- - name : Download PHPStan
71- run : wget https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
72-
7361 - name : Generate new baseline
7462 id : generate-baseline
7563 run : |
7664 cp phpstan-baseline.neon phpstan-baseline.neon.old
77- php phpstan.phar analyse --configuration phpstan.neon --generate-baseline
65+ vendor/bin/ phpstan analyse --configuration phpstan.neon --generate-baseline
7866 if ! diff -q phpstan-baseline.neon phpstan-baseline.neon.old > /dev/null; then
7967 echo "baseline_changed=true" >> $GITHUB_OUTPUT
8068 fi
0 commit comments