@@ -3,45 +3,64 @@ name: CI
33on : [push]
44
55jobs :
6- build :
6+ composer :
77 runs-on : ubuntu-latest
88
99 steps :
1010 - uses : actions/checkout@v2
11- - uses : php-actions/composer@v4
12- - name : Upload build for test runner
11+
12+ - name : Cache Composer dependencies
13+ uses : actions/cache@v2
14+ with :
15+ path : /tmp/composer-cache
16+ key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
17+
18+ - uses : php-actions/composer@v5
19+
20+ - name : Archive build
21+ run : mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
22+
23+ - name : Upload build archive for test runners
1324 uses : actions/upload-artifact@v2
1425 with :
1526 name : build-artifact
16- path : ./
27+ path : /tmp/github-actions
1728
1829 phpunit :
1930 runs-on : ubuntu-latest
20- needs : [build ]
31+ needs : [composer ]
2132
2233 steps :
2334 - uses : actions/download-artifact@v2
2435 with :
2536 name : build-artifact
26- path : ./
37+ path : /tmp/github-actions
38+
39+ - name : Extract build archive
40+ run : tar -xvf /tmp/github-actions/build.tar ./
2741
2842 - name : PHP Unit tests
29- uses : php-actions/phpunit@v1
43+ uses : php-actions/phpunit@v2
3044 with :
31- bootstrap : vendor/autoload.php
45+ php_version : 8.0
46+ php_extensions : xdebug
3247 configuration : test/phpunit/phpunit.xml
48+ bootstrap : vendor/autoload.php
3349
3450 phpstan :
3551 runs-on : ubuntu-latest
36- needs : [build ]
52+ needs : [composer ]
3753
3854 steps :
3955 - uses : actions/download-artifact@v2
4056 with :
4157 name : build-artifact
42- path : ./
58+ path : /tmp/github-actions
59+
60+ - name : Extract build archive
61+ run : tar -xvf /tmp/github-actions/build.tar ./
4362
4463 - name : PHP Static Analysis
45- uses : php-actions/phpstan@v1
64+ uses : php-actions/phpstan@v2
4665 with :
4766 path : src/
0 commit comments