1
- on : push
1
+ on :
2
+ push :
3
+ branches :
4
+ - master
5
+ pull_request :
2
6
name : Qa workflow
3
7
jobs :
4
8
setup :
5
9
runs-on : ubuntu-latest
6
10
steps :
7
11
- uses : actions/checkout@master
8
- - name : Restore/cache vendor folder
9
- uses : actions/cache@v1
10
- with :
11
- path : vendor
12
- key : all-build-${{ hashFiles('**/composer.lock') }}
13
- restore-keys : |
14
- all-build-${{ hashFiles('**/composer.lock') }}
15
- all-build-
12
+
16
13
- name : Restore/cache tools folder
17
14
uses : actions/cache@v1
18
15
with :
@@ -21,37 +18,41 @@ jobs:
21
18
restore-keys : |
22
19
all-tools-${{ github.sha }}-
23
20
all-tools-
21
+
24
22
- name : composer
25
23
uses : docker://composer
26
24
env :
27
25
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
26
with :
29
27
args : install --no-interaction --prefer-dist --optimize-autoloader
28
+
30
29
- name : composer-require-checker
31
30
uses : docker://phpga/composer-require-checker-ga
32
31
env :
33
32
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
33
with :
35
34
args : check --config-file ./composer-require-config.json composer.json
35
+
36
36
- name : Install phive
37
37
run : make install-phive
38
+
38
39
- name : Install PHAR dependencies
39
- run : tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned
40
+ run : tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,8A03EA3B385DBAA1 --force-accept-unsigned
40
41
41
42
phpunit-with-coverage :
42
43
runs-on : ubuntu-latest
43
44
name : Unit tests
44
45
needs : setup
45
46
steps :
46
47
- uses : actions/checkout@master
47
- - name : Restore/cache vendor folder
48
- uses : actions/cache@v1
48
+
49
+ - name : Setup PHP
50
+ uses : shivammathur/setup-php@v2
49
51
with :
50
- path : vendor
51
- key : all-build-${{ hashFiles('**/composer.lock') }}
52
- restore-keys : |
53
- all-build-${{ hashFiles('**/composer.lock') }}
54
- all-build-
52
+ php-version : 7.2
53
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
54
+ coverage : pcov
55
+
55
56
- name : Restore/cache tools folder
56
57
uses : actions/cache@v1
57
58
with :
@@ -60,14 +61,22 @@ jobs:
60
61
restore-keys : |
61
62
all-tools-${{ github.sha }}-
62
63
all-tools-
63
- - name : Setup PHP
64
- uses : shivammathur/setup-php@master
64
+
65
+ - name : Get composer cache directory
66
+ id : composer-cache
67
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
68
+
69
+ - name : Cache composer dependencies
70
+ uses : actions/cache@v1
65
71
with :
66
- php-version : 7.2
67
- extension-csv : mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
68
- ini-values-csv : memory_limit=2G, display_errors=On, error_reporting=-1
69
- coverage : xdebug
70
- pecl : false
72
+ path : ${{ steps.composer-cache.outputs.dir }}
73
+ key : ubuntu-latest-composer-${{ hashFiles('**/composer.lock') }}
74
+ restore-keys : ubuntu-latest-composer-
75
+
76
+ - name : Install Composer dependencies
77
+ run : |
78
+ composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
79
+
71
80
- name : Run PHPUnit
72
81
run : php tools/phpunit
73
82
86
95
- phpunit-with-coverage
87
96
steps :
88
97
- uses : actions/checkout@master
98
+
89
99
- name : Restore/cache vendor folder
90
100
uses : actions/cache@v1
91
101
with :
94
104
restore-keys : |
95
105
all-build-${{ hashFiles('**/composer.lock') }}
96
106
all-build-
107
+
97
108
- name : Restore/cache tools folder
98
109
uses : actions/cache@v1
99
110
with :
@@ -102,13 +113,29 @@ jobs:
102
113
restore-keys : |
103
114
all-tools-${{ github.sha }}-
104
115
all-tools-
116
+
105
117
- name : Setup PHP
106
- uses : shivammathur/setup-php@master
118
+ uses : shivammathur/setup-php@v2
107
119
with :
108
120
php-version : ${{ matrix.php-versions }}
109
- extension-csv : mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
110
- ini-values-csv : memory_limit=2G, display_errors=On, error_reporting=-1
111
- pecl : false
121
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
122
+ coverage : none
123
+
124
+ - name : Get composer cache directory
125
+ id : composer-cache
126
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
127
+
128
+ - name : Cache composer dependencies
129
+ uses : actions/cache@v1
130
+ with :
131
+ path : ${{ steps.composer-cache.outputs.dir }}
132
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
133
+ restore-keys : ${{ runner.os }}-composer-
134
+
135
+ - name : Install Composer dependencies
136
+ run : |
137
+ composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
138
+
112
139
- name : Run PHPUnit
113
140
continue-on-error : true
114
141
run : php tools/phpunit
@@ -126,20 +153,10 @@ jobs:
126
153
restore-keys : |
127
154
all-build-${{ hashFiles('**/composer.lock') }}
128
155
all-build-
129
- - name : Restore/cache tools folder
130
- uses : actions/cache@v1
131
- with :
132
- path : tools
133
- key : all-tools-${{ github.sha }}
134
- restore-keys : |
135
- all-tools-${{ github.sha }}-
136
- all-tools-
137
156
- name : Code style check
138
- uses : docker://phpdoc/phpcs-ga:latest
139
- env :
140
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157
+ uses : phpDocumentor/coding-standard@master
141
158
with :
142
- args : -d memory_limit=1024M
159
+ args : -s
143
160
144
161
phpstan :
145
162
runs-on : ubuntu-latest
@@ -154,53 +171,53 @@ jobs:
154
171
restore-keys : |
155
172
all-build-${{ hashFiles('**/composer.lock') }}
156
173
all-build-
157
- - name : Restore/cache tools folder
158
- uses : actions/cache@v1
159
- with :
160
- path : tools
161
- key : all-tools-${{ github.sha }}
162
- restore-keys : |
163
- all-tools-${{ github.sha }}-
164
- all-tools-
165
174
- name : PHPStan
166
- uses : docker://phpdoc/ phpstan-ga:latest
175
+ uses : phpDocumentor/ phpstan-ga@master
167
176
env :
168
177
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
169
178
with :
170
- args : analyse src --level max -- configuration phpstan.neon
179
+ args : analyse src --configuration phpstan.neon
171
180
172
181
psalm :
173
182
runs-on : ubuntu-latest
174
183
needs : [setup, phpunit]
175
184
steps :
176
185
- uses : actions/checkout@master
177
- - name : Restore/cache vendor folder
178
- uses : actions/cache@v1
186
+
187
+ - name : Setup PHP
188
+ uses : shivammathur/setup-php@v2
179
189
with :
180
- path : vendor
181
- key : all-build-${{ hashFiles('**/composer.lock') }}
182
- restore-keys : |
183
- all-build-${{ hashFiles('**/composer.lock') }}
184
- all-build-
185
- - name : Restore/cache tools folder
190
+ php-version : 7.2
191
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
192
+ tools : psalm
193
+ coverage : none
194
+
195
+ - name : Get composer cache directory
196
+ id : composer-cache
197
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
198
+
199
+ - name : Cache composer dependencies
186
200
uses : actions/cache@v1
187
201
with :
188
- path : tools
189
- key : all-tools-${{ github.sha }}
190
- restore-keys : |
191
- all-tools-${{ github.sha }}-
192
- all-tools-
202
+ path : ${{ steps.composer-cache.outputs.dir }}
203
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
204
+ restore-keys : ${{ runner.os }}-composer-
205
+
206
+ - name : Install Composer dependencies
207
+ run : |
208
+ composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
209
+
193
210
- name : Psalm
194
- uses : docker://mickaelandrieu/psalm-ga
195
- env :
196
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
211
+ run : psalm --output-format=github
197
212
198
213
bc_check :
199
214
name : BC Check
200
215
runs-on : ubuntu-latest
201
216
needs : [setup, phpunit]
202
217
steps :
203
218
- uses : actions/checkout@master
219
+ - name : fetch tags
220
+ run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
204
221
- name : Restore/cache vendor folder
205
222
uses : actions/cache@v1
206
223
with :
@@ -211,3 +228,52 @@ jobs:
211
228
all-build-
212
229
- name : Roave BC Check
213
230
uses : docker://nyholm/roave-bc-check-ga
231
+
232
+ profile :
233
+ runs-on : ubuntu-latest
234
+ name : profile
235
+ needs : [setup, phpunit]
236
+ services :
237
+ blackfire :
238
+ image : blackfire/blackfire
239
+ ports :
240
+ - 8707:8707
241
+ env :
242
+ BLACKFIRE_SERVER_ID : " 517a7aa6-1ec8-4d29-bff8-dddecf4333de"
243
+ BLACKFIRE_SERVER_TOKEN : " 21795bdce7c0b5d24f0ccbb42e2a7518feb5359840752b163652899f927cbf2b"
244
+
245
+ steps :
246
+ - uses : actions/checkout@master
247
+
248
+ - name : Setup PHP
249
+ uses : shivammathur/setup-php@v2
250
+ with :
251
+ php-version : 7.2
252
+ extensions : blackfire
253
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1, blackfire.agent_socket=tcp://localhost:8707
254
+ coverage : none
255
+
256
+ - name : Get Composer Cache Directory
257
+ id : composer-cache
258
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
259
+
260
+ - name : Cache dependencies
261
+ uses : actions/cache@v1
262
+ with :
263
+ path : ${{ steps.composer-cache.outputs.dir }}
264
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
265
+ restore-keys : ${{ runner.os }}-composer-
266
+
267
+ - name : Install dependencies
268
+ run : composer install --prefer-dist --no-progress --no-suggest
269
+
270
+ - name : Install phpbench
271
+ run : |
272
+ composer global require jaapio/phpbench-blackfire:1.x-dev@dev && \
273
+ sudo ln -sf "$(composer -q global config home)"/vendor/bin/phpbench /usr/local/bin/phpbench
274
+
275
+ - name : Run phpbench
276
+ run : phpbench run -l blackfire --revs=1 --tag="Build_PR_${{ github.event.number }}"
277
+ env :
278
+ BLACKFIRE_CLIENT_ID : ${{ secrets.BLACKFIRE_CLIENT_ID }}
279
+ BLACKFIRE_CLIENT_TOKEN : ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
0 commit comments