9
9
jobs :
10
10
phpstan :
11
11
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
+
12
19
steps :
13
20
- uses : actions/checkout@v4
14
21
15
- - name : Setup PHP 7.4 for dependencies
22
+ - name : Setup PHP ${{ matrix.php }} for dependencies
16
23
uses : shivammathur/setup-php@v2
17
24
with :
18
- php-version : 7.4
25
+ php-version : ${{ matrix.php }}
19
26
20
27
- name : Install Dependencies
21
28
run : composer update --ignore-platform-reqs
22
29
23
- - name : Setup PHP 8.2 for PHPStan
24
- uses : shivammathur/setup-php@v2
25
- with :
26
- php-version : 8.2
27
-
28
30
- name : Restore PHPStan cache
29
31
id : cache-phpstan
30
32
uses : actions/cache/restore@v3
31
33
with :
32
34
path : phpstan.phar
33
35
key : phpstan-1
34
36
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
-
39
37
- name : Run PHPStan
40
- run : php phpstan.phar analyse --configuration phpstan.neon
38
+ run : vendor/bin/ phpstan analyse --configuration phpstan.neon
41
39
42
40
update-baseline :
43
41
needs : phpstan
44
42
if : github.event_name == 'push' && github.ref == 'refs/heads/alpha'
45
43
runs-on : ubuntu-latest
44
+ # define every php version to test
45
+ strategy :
46
+ # do not stop at first fail
47
+ fail-fast : false
48
+ matrix :
49
+ php : [7.4, 8.2]
46
50
steps :
47
51
- uses : actions/checkout@v4
48
52
with :
@@ -54,27 +58,19 @@ jobs:
54
58
git push origin --delete update-phpstan-baseline
55
59
fi
56
60
57
- - name : Setup PHP 7.4 for dependencies
61
+ - name : Setup PHP ${{ matrix.php }} for dependencies
58
62
uses : shivammathur/setup-php@v2
59
63
with :
60
- php-version : 7.4
64
+ php-version : ${{ matrix.php }}
61
65
62
66
- name : Install Dependencies
63
67
run : composer update --ignore-platform-reqs
64
68
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
-
73
69
- name : Generate new baseline
74
70
id : generate-baseline
75
71
run : |
76
72
cp phpstan-baseline.neon phpstan-baseline.neon.old
77
- php phpstan.phar analyse --configuration phpstan.neon --generate-baseline
73
+ vendor/bin/ phpstan analyse --configuration phpstan.neon --generate-baseline
78
74
if ! diff -q phpstan-baseline.neon phpstan-baseline.neon.old > /dev/null; then
79
75
echo "baseline_changed=true" >> $GITHUB_OUTPUT
80
76
fi
0 commit comments