44 - 1.x
55 pull_request :
66name : Qa workflow
7+ env :
8+ phiveGPGKeys : 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8A03EA3B385DBAA1
79jobs :
8- setup :
10+ composer-check :
911 runs-on : ubuntu-latest
1012 steps :
1113 - uses : actions/checkout@v2
1214
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-
2215 - name : composer
2316 uses : docker://composer
2417 env :
3326 with :
3427 args : check --config-file ./composer-require-config.json composer.json
3528
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-
4229 phpunit-with-coverage :
4330 runs-on : ubuntu-latest
4431 name : Unit tests
45- needs : setup
4632 steps :
4733 - uses : actions/checkout@v2
4834
@@ -52,27 +38,17 @@ jobs:
5238 php-version : 7.2
5339 ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
5440 coverage : pcov
41+ tools : phive
5542
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
6447
6548 - name : Get composer cache directory
6649 id : composer-cache
6750 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
6851
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-
7652 - name : Install Composer dependencies
7753 run : |
7854 composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
@@ -81,70 +57,88 @@ jobs:
8157 run : php tools/phpunit
8258
8359 phpunit :
60+ name : Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
8461 runs-on : ${{ matrix.operating-system }}
62+ continue-on-error : ${{ matrix.php-versions == '8.1' }}
8563 strategy :
8664 matrix :
8765 operating-system :
8866 - ubuntu-latest
8967 - windows-latest
9068 - macOS-latest
91- php-versions : ['7.2', '7.3', '7.4', '8.0']
92- name : Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
69+ php-versions : ['7.2', '7.3', '7.4', '8.0', '8.1']
70+ env :
71+ extensions : mbstring
72+ key : cache-v1 # can be any string, change to clear the extension cache.
73+
9374 needs :
94- - setup
9575 - phpunit-with-coverage
76+
9677 steps :
9778 - uses : actions/checkout@v2
9879
99- - name : Restore/cache vendor folder
100- uses : actions/cache@v2
80+ - name : Setup cache environment
81+ id : cache-env
82+ uses : shivammathur/cache-extensions@v1
10183 with :
102- path : vendor
103- key : all-build-${{ hashFiles('**/composer.lock') }}
104- restore-keys : |
105- all-build-${{ hashFiles('**/composer.lock') }}
106- all-build-
84+ php-version : ${{ matrix.php-versions }}
85+ extensions : ${{ env.extensions }}
86+ key : ${{ env.key }}
10787
108- - name : Restore/cache tools folder
88+ - name : Cache extensions
10989 uses : actions/cache@v2
11090 with :
111- path : tools
112- key : all-tools-${{ github.sha }}
113- restore-keys : |
114- all-tools-${{ github.sha }}-
115- all-tools-
91+ path : ${{ steps.cache-env.outputs.dir }}
92+ key : ${{ steps.cache-env.outputs.key }}
11693
11794 - name : Setup PHP
11895 uses : shivammathur/setup-php@v2
11996 with :
12097 php-version : ${{ matrix.php-versions }}
98+ extensions : ${{ env.extensions }}
12199 ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
122- coverage : none
100+ tools : phive
101+
102+ - name : Install PHAR dependencies
103+ env :
104+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105+ run : phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned
106+
107+ - name : Install phpunit 8 for php 7.2
108+ if : matrix.php-versions == '7.2'
109+ env :
110+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
111+ run : phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} phpunit:^8.5
123112
124113 - name : Get composer cache directory
125114 id : composer-cache
126115 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
127116
128- - name : Cache composer dependencies
117+ - name : Cache dependencies
129118 uses : actions/cache@v2
130119 with :
131120 path : ${{ steps.composer-cache.outputs.dir }}
132121 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
133122 restore-keys : ${{ runner.os }}-composer-
134123
135- - name : Install Composer dependencies
136- run : |
137- composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
124+ - name : Install dependencies
125+ run : composer install --no-interaction --prefer-dist --optimize-autoloader
138126
139127 - name : Run PHPUnit
140128 continue-on-error : true
141129 run : php tools/phpunit
142130
143131 codestyle :
144132 runs-on : ubuntu-latest
145- needs : [setup, phpunit]
133+ needs : [phpunit]
146134 steps :
147135 - uses : actions/checkout@v2
136+ - name : composer
137+ uses : docker://composer
138+ env :
139+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
140+ with :
141+ args : install --no-interaction --prefer-dist --optimize-autoloader
148142 - name : Restore/cache vendor folder
149143 uses : actions/cache@v2
150144 with :
@@ -160,64 +154,93 @@ jobs:
160154
161155 phpstan :
162156 runs-on : ubuntu-latest
163- needs : [setup, phpunit]
157+ needs : [phpunit]
164158 steps :
165159 - uses : actions/checkout@v2
166- - name : Restore/cache vendor folder
167- uses : actions/cache@v2
160+ - name : composer
161+ uses : docker://composer
162+ env :
163+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168164 with :
169- path : vendor
170- key : all-build-${{ hashFiles('**/composer.lock') }}
171- restore-keys : |
172- all-build-${{ hashFiles('**/composer.lock') }}
173- all-build-
165+ args : install --no-interaction --prefer-dist --optimize-autoloader
166+
174167 - name : PHPStan
175- uses : phpDocumentor/phpstan-ga@master
168+ uses : phpDocumentor/phpstan-ga@0.12.9
176169 env :
177170 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
178171 with :
179172 args : analyse src --configuration phpstan.neon
180173
181174 psalm :
182- runs-on : ubuntu-latest
183- needs : [setup, phpunit]
175+ name : Psalm
176+ runs-on : ${{ matrix.operating-system }}
177+ strategy :
178+ matrix :
179+ operating-system :
180+ - ubuntu-latest
181+ php-versions : ['7.3']
182+ env :
183+ extensions : mbstring
184+ key : cache-v1 # can be any string, change to clear the extension cache.
185+
186+ needs :
187+ - phpunit
188+
184189 steps :
185190 - uses : actions/checkout@v2
186191
192+ - name : Setup cache environment
193+ id : cache-env
194+ uses : shivammathur/cache-extensions@v1
195+ with :
196+ php-version : ${{ matrix.php-versions }}
197+ extensions : ${{ env.extensions }}
198+ key : ${{ env.key }}
199+
200+ - name : Cache extensions
201+ uses : actions/cache@v2
202+ with :
203+ path : ${{ steps.cache-env.outputs.dir }}
204+ key : ${{ steps.cache-env.outputs.key }}
205+
187206 - name : Setup PHP
188207 uses : shivammathur/setup-php@v2
189208 with :
190- php-version : 7.2
209+ php-version : ${{ matrix.php-versions }}
210+ extensions : ${{ env.extensions }}
191211 ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
192- tools : psalm
193- coverage : none
194212
195213 - name : Get composer cache directory
196214 id : composer-cache
197215 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
198216
199- - name : Cache composer dependencies
217+ - name : Cache dependencies
200218 uses : actions/cache@v2
201219 with :
202220 path : ${{ steps.composer-cache.outputs.dir }}
203221 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
204222 restore-keys : ${{ runner.os }}-composer-
205223
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
209226
210- - name : Psalm
211- run : psalm --output-format=github
227+ - name : Run psalm
228+ run : vendor/bin/ psalm.phar
212229
213230 bc_check :
214231 name : BC Check
215232 runs-on : ubuntu-latest
216- needs : [setup, phpunit]
233+ needs : [phpunit]
217234 steps :
218235 - uses : actions/checkout@v2
219236 - name : fetch tags
220237 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
221244 - name : Restore/cache vendor folder
222245 uses : actions/cache@v2
223246 with :
@@ -232,7 +255,7 @@ jobs:
232255 profile :
233256 runs-on : ubuntu-latest
234257 name : profile
235- needs : [setup, phpunit]
258+ needs : [phpunit]
236259 services :
237260 blackfire :
238261 image : blackfire/blackfire
0 commit comments