4
4
- 1.x
5
5
pull_request :
6
6
name : Qa workflow
7
+ env :
8
+ phiveGPGKeys : 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8A03EA3B385DBAA1
7
9
jobs :
8
- setup :
10
+ composer-check :
9
11
runs-on : ubuntu-latest
10
12
steps :
11
13
- uses : actions/checkout@v2
12
14
13
- - name : Restore/cache tools folder
14
- uses : actions/cache@v2
15
- with :
16
- path : tools
17
- key : all-tools-${{ github.sha }}
18
- restore-keys : |
19
- all-tools-${{ github.sha }}-
20
- all-tools-
21
-
22
15
- name : composer
23
16
uses : docker://composer
24
17
env :
33
26
with :
34
27
args : check --config-file ./composer-require-config.json composer.json
35
28
36
- - name : Install phive
37
- run : make install-phive
38
-
39
- - name : Install PHAR dependencies
40
- run : tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,8A03EA3B385DBAA1 --force-accept-unsigned
41
-
42
29
phpunit-with-coverage :
43
30
runs-on : ubuntu-latest
44
31
name : Unit tests
45
- needs : setup
46
32
steps :
47
33
- uses : actions/checkout@v2
48
34
@@ -52,27 +38,17 @@ jobs:
52
38
php-version : 7.2
53
39
ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
54
40
coverage : pcov
41
+ tools : phive
55
42
56
- - name : Restore/cache tools folder
57
- uses : actions/cache@v2
58
- with :
59
- path : tools
60
- key : all-tools-${{ github.sha }}
61
- restore-keys : |
62
- all-tools-${{ github.sha }}-
63
- all-tools-
43
+ - name : Install PHAR dependencies
44
+ env :
45
+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
+ run : phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned
64
47
65
48
- name : Get composer cache directory
66
49
id : composer-cache
67
50
run : echo "::set-output name=dir::$(composer config cache-files-dir)"
68
51
69
- - name : Cache composer dependencies
70
- uses : actions/cache@v2
71
- with :
72
- path : ${{ steps.composer-cache.outputs.dir }}
73
- key : ubuntu-latest-composer-${{ hashFiles('**/composer.lock') }}
74
- restore-keys : ubuntu-latest-composer-
75
-
76
52
- name : Install Composer dependencies
77
53
run : |
78
54
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
81
57
run : php tools/phpunit
82
58
83
59
phpunit :
60
+ name : Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
84
61
runs-on : ${{ matrix.operating-system }}
85
62
strategy :
86
63
matrix :
@@ -89,62 +66,78 @@ jobs:
89
66
- windows-latest
90
67
- macOS-latest
91
68
php-versions : ['7.2', '7.3', '7.4', '8.0', '8.1']
92
- name : Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
69
+ env :
70
+ extensions : mbstring
71
+ key : cache-v1 # can be any string, change to clear the extension cache.
72
+
93
73
needs :
94
- - setup
95
74
- phpunit-with-coverage
75
+
96
76
steps :
97
77
- uses : actions/checkout@v2
98
78
99
- - name : Restore/cache vendor folder
100
- uses : actions/cache@v2
79
+ - name : Setup cache environment
80
+ id : cache-env
81
+ uses : shivammathur/cache-extensions@v1
101
82
with :
102
- path : vendor
103
- key : all-build-${{ hashFiles('**/composer.lock') }}
104
- restore-keys : |
105
- all-build-${{ hashFiles('**/composer.lock') }}
106
- all-build-
83
+ php-version : ${{ matrix.php-versions }}
84
+ extensions : ${{ env.extensions }}
85
+ key : ${{ env.key }}
107
86
108
- - name : Restore/cache tools folder
87
+ - name : Cache extensions
109
88
uses : actions/cache@v2
110
89
with :
111
- path : tools
112
- key : all-tools-${{ github.sha }}
113
- restore-keys : |
114
- all-tools-${{ github.sha }}-
115
- all-tools-
90
+ path : ${{ steps.cache-env.outputs.dir }}
91
+ key : ${{ steps.cache-env.outputs.key }}
116
92
117
93
- name : Setup PHP
118
94
uses : shivammathur/setup-php@v2
119
95
with :
120
96
php-version : ${{ matrix.php-versions }}
97
+ extensions : ${{ env.extensions }}
121
98
ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
122
- coverage : none
99
+ tools : phive
100
+
101
+ - name : Install PHAR dependencies
102
+ env :
103
+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104
+ run : phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned
105
+
106
+ - name : Install phpunit 8 for php 7.2
107
+ if : matrix.php-versions == '7.2'
108
+ env :
109
+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110
+ run : phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} phpunit:^8.5
123
111
124
112
- name : Get composer cache directory
125
113
id : composer-cache
126
114
run : echo "::set-output name=dir::$(composer config cache-files-dir)"
127
115
128
- - name : Cache composer dependencies
116
+ - name : Cache dependencies
129
117
uses : actions/cache@v2
130
118
with :
131
119
path : ${{ steps.composer-cache.outputs.dir }}
132
120
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
133
121
restore-keys : ${{ runner.os }}-composer-
134
122
135
- - name : Install Composer dependencies
136
- run : |
137
- composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
123
+ - name : Install dependencies
124
+ run : composer install --no-interaction --prefer-dist --optimize-autoloader
138
125
139
126
- name : Run PHPUnit
140
127
continue-on-error : true
141
128
run : php tools/phpunit
142
129
143
130
codestyle :
144
131
runs-on : ubuntu-latest
145
- needs : [setup, phpunit]
132
+ needs : [phpunit]
146
133
steps :
147
134
- uses : actions/checkout@v2
135
+ - name : composer
136
+ uses : docker://composer
137
+ env :
138
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139
+ with :
140
+ args : install --no-interaction --prefer-dist --optimize-autoloader
148
141
- name : Restore/cache vendor folder
149
142
uses : actions/cache@v2
150
143
with :
@@ -160,64 +153,94 @@ jobs:
160
153
161
154
phpstan :
162
155
runs-on : ubuntu-latest
163
- needs : [setup, phpunit]
156
+ needs : [phpunit]
164
157
steps :
165
158
- uses : actions/checkout@v2
166
- - name : Restore/cache vendor folder
167
- uses : actions/cache@v2
159
+ - name : composer
160
+ uses : docker://composer
161
+ env :
162
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168
163
with :
169
- path : vendor
170
- key : all-build-${{ hashFiles('**/composer.lock') }}
171
- restore-keys : |
172
- all-build-${{ hashFiles('**/composer.lock') }}
173
- all-build-
164
+ args : install --no-interaction --prefer-dist --optimize-autoloader
165
+
174
166
- name : PHPStan
175
- uses : phpDocumentor/phpstan-ga@master
167
+ uses : phpDocumentor/phpstan-ga@0.12.9
176
168
env :
177
169
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
178
170
with :
179
171
args : analyse src --configuration phpstan.neon
180
172
181
173
psalm :
182
- runs-on : ubuntu-latest
183
- needs : [setup, phpunit]
174
+ name : Psalm
175
+ runs-on : ${{ matrix.operating-system }}
176
+ strategy :
177
+ matrix :
178
+ operating-system :
179
+ - ubuntu-latest
180
+ php-versions : ['7.2']
181
+ env :
182
+ extensions : mbstring
183
+ key : cache-v1 # can be any string, change to clear the extension cache.
184
+
185
+ needs :
186
+ - phpunit
187
+
184
188
steps :
185
189
- uses : actions/checkout@v2
186
190
191
+ - name : Setup cache environment
192
+ id : cache-env
193
+ uses : shivammathur/cache-extensions@v1
194
+ with :
195
+ php-version : ${{ matrix.php-versions }}
196
+ extensions : ${{ env.extensions }}
197
+ key : ${{ env.key }}
198
+
199
+ - name : Cache extensions
200
+ uses : actions/cache@v2
201
+ with :
202
+ path : ${{ steps.cache-env.outputs.dir }}
203
+ key : ${{ steps.cache-env.outputs.key }}
204
+
187
205
- name : Setup PHP
188
206
uses : shivammathur/setup-php@v2
189
207
with :
190
- php-version : 7.2
191
- ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
208
+ php-version : ${{ matrix.php-versions }}
209
+ extensions : ${{ env.extensions }}
192
210
tools : psalm
193
- coverage : none
211
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
194
212
195
213
- name : Get composer cache directory
196
214
id : composer-cache
197
215
run : echo "::set-output name=dir::$(composer config cache-files-dir)"
198
216
199
- - name : Cache composer dependencies
217
+ - name : Cache dependencies
200
218
uses : actions/cache@v2
201
219
with :
202
220
path : ${{ steps.composer-cache.outputs.dir }}
203
221
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
204
222
restore-keys : ${{ runner.os }}-composer-
205
223
206
- - name : Install Composer dependencies
207
- run : |
208
- composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
224
+ - name : Install dependencies
225
+ run : composer install --no-interaction --prefer-dist --optimize-autoloader
209
226
210
- - name : Psalm
227
+ - name : Run psalm
211
228
run : psalm --output-format=github
212
229
213
230
bc_check :
214
231
name : BC Check
215
232
runs-on : ubuntu-latest
216
- needs : [setup, phpunit]
233
+ needs : [phpunit]
217
234
steps :
218
235
- uses : actions/checkout@v2
219
236
- name : fetch tags
220
237
run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
238
+ - name : composer
239
+ uses : docker://composer
240
+ env :
241
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
242
+ with :
243
+ args : install --no-interaction --prefer-dist --optimize-autoloader
221
244
- name : Restore/cache vendor folder
222
245
uses : actions/cache@v2
223
246
with :
@@ -232,7 +255,7 @@ jobs:
232
255
profile :
233
256
runs-on : ubuntu-latest
234
257
name : profile
235
- needs : [setup, phpunit]
258
+ needs : [phpunit]
236
259
services :
237
260
blackfire :
238
261
image : blackfire/blackfire
0 commit comments