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
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 }}
8562 strategy :
8663 matrix :
@@ -89,62 +66,78 @@ jobs:
8966 - windows-latest
9067 - macOS-latest
9168 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+
9373 needs :
94- - setup
9574 - phpunit-with-coverage
75+
9676 steps :
9777 - uses : actions/checkout@v2
9878
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
10182 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 }}
10786
108- - name : Restore/cache tools folder
87+ - name : Cache extensions
10988 uses : actions/cache@v2
11089 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 }}
11692
11793 - name : Setup PHP
11894 uses : shivammathur/setup-php@v2
11995 with :
12096 php-version : ${{ matrix.php-versions }}
97+ extensions : ${{ env.extensions }}
12198 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
123111
124112 - name : Get composer cache directory
125113 id : composer-cache
126114 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
127115
128- - name : Cache composer dependencies
116+ - name : Cache dependencies
129117 uses : actions/cache@v2
130118 with :
131119 path : ${{ steps.composer-cache.outputs.dir }}
132120 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
133121 restore-keys : ${{ runner.os }}-composer-
134122
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
138125
139126 - name : Run PHPUnit
140127 continue-on-error : true
141128 run : php tools/phpunit
142129
143130 codestyle :
144131 runs-on : ubuntu-latest
145- needs : [setup, phpunit]
132+ needs : [phpunit]
146133 steps :
147134 - 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
148141 - name : Restore/cache vendor folder
149142 uses : actions/cache@v2
150143 with :
@@ -160,64 +153,94 @@ jobs:
160153
161154 phpstan :
162155 runs-on : ubuntu-latest
163- needs : [setup, phpunit]
156+ needs : [phpunit]
164157 steps :
165158 - 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 }}
168163 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+
174166 - name : PHPStan
175- uses : phpDocumentor/phpstan-ga@master
167+ uses : phpDocumentor/phpstan-ga@0.12.9
176168 env :
177169 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
178170 with :
179171 args : analyse src --configuration phpstan.neon
180172
181173 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+
184188 steps :
185189 - uses : actions/checkout@v2
186190
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+
187205 - name : Setup PHP
188206 uses : shivammathur/setup-php@v2
189207 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 }}
192210 tools : psalm
193- coverage : none
211+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
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
227+ - name : Run psalm
211228 run : psalm --output-format=github
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