1
- on : push
1
+ on :
2
+ push :
3
+ branches :
4
+ - master
5
+ pull_request :
2
6
name : Qa workflow
7
+ env :
8
+ extensions : mbstring, intl, iconv, libxml, dom, json, simplexml, zlib, fileinfo
9
+ key : cache-v1 # can be any string, change to clear the extension cache.
10
+ defaultPHPVersion : ' 7.3'
3
11
jobs :
4
- setup :
5
- runs-on : ubuntu-latest
6
- steps :
7
- - 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-
16
- - name : Restore/cache tools folder
17
- uses : actions/cache@v1
18
- with :
19
- path : tools
20
- key : all-tools-${{ github.sha }}
21
- restore-keys : |
22
- all-tools-${{ github.sha }}-
23
- all-tools-
24
- - name : composer
25
- uses : docker://composer
26
- env :
27
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
- with :
29
- args : install --no-interaction --prefer-dist --optimize-autoloader
30
- - name : Install phive
31
- run : make install-phive
32
- - name : Install PHAR dependencies
33
- run : tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned
34
-
35
12
phpunit-with-coverage :
36
13
runs-on : ubuntu-latest
37
14
name : Unit tests
38
- needs : setup
39
15
steps :
40
- - uses : actions/checkout@master
41
- - name : Restore/cache vendor folder
42
- uses : actions/cache@v1
43
- with :
44
- path : vendor
45
- key : all-build-${{ hashFiles('**/composer.lock') }}
46
- restore-keys : |
47
- all-build-${{ hashFiles('**/composer.lock') }}
48
- all-build-
49
- - name : Restore/cache tools folder
50
- uses : actions/cache@v1
51
- with :
52
- path : tools
53
- key : all-tools-${{ github.sha }}
54
- restore-keys : |
55
- all-tools-${{ github.sha }}-
56
- all-tools-
16
+ - uses : actions/checkout@v2
17
+
57
18
- name : Install graphviz
58
19
run : sudo apt-get update && sudo apt-get install -y graphviz
20
+
59
21
- name : Setup PHP
60
- uses : shivammathur/setup-php@master
22
+ uses : shivammathur/setup-php@v2
61
23
with :
62
- php-version : 7.2
63
- extension-csv : mbstring, simplexml
64
- ini-values-csv : memory_limit=2G, display_errors=On, error_reporting=-1
65
- coverage : xdebug
66
- pecl : false
24
+ php-version : ${{ env.defaultPHPVersion }}
25
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
26
+ tools : phive
27
+
28
+ - name : Get composer cache directory
29
+ id : composer-cache
30
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
31
+
32
+ - name : Cache composer dependencies
33
+ uses : actions/cache@v2
34
+ with :
35
+ path : ${{ steps.composer-cache.outputs.dir }}
36
+ key : composer-${{ hashFiles('**/composer.lock') }}
37
+ restore-keys : composer-
38
+
39
+ - name : Install Composer dependencies
40
+ run : |
41
+ composer install --no-progress --prefer-dist --optimize-autoloader
42
+
67
43
- name : Run PHPUnit
68
44
run : php vendor/bin/phpunit
69
- - name : Upload to Scrutinizer
70
- run : tools/ocular code-coverage:upload --format=php-clover build/logs/clover.xml
71
45
72
46
phpunit :
73
47
runs-on : ${{ matrix.operating-system }}
74
48
strategy :
75
49
matrix :
76
50
operating-system :
77
51
- ubuntu-latest
78
- php-versions : ['7.2', '7.3', '7.4']
52
+ php-versions : ['7.2', '7.3', '7.4', '8.0' ]
79
53
name : Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
80
54
needs :
81
- - setup
82
55
- phpunit-with-coverage
83
56
steps :
84
- - uses : actions/checkout@master
85
- - name : Restore/cache vendor folder
86
- uses : actions/cache@v1
87
- with :
88
- path : vendor
89
- key : all-build-${{ hashFiles('**/composer.lock') }}
90
- restore-keys : |
91
- all-build-${{ hashFiles('**/composer.lock') }}
92
- all-build-
93
- - name : Restore/cache tools folder
94
- uses : actions/cache@v1
95
- with :
96
- path : tools
97
- key : all-tools-${{ github.sha }}
98
- restore-keys : |
99
- all-tools-${{ github.sha }}-
100
- all-tools-
57
+ - uses : actions/checkout@v2
58
+
59
+ - name : Install graphviz
60
+ run : sudo apt-get update && sudo apt-get install -y graphviz
61
+
101
62
- name : Setup PHP
102
- uses : shivammathur/setup-php@master
63
+ uses : shivammathur/setup-php@v2
103
64
with :
104
65
php-version : ${{ matrix.php-versions }}
105
66
extension-csv : mbstring, simplexml
106
- ini-values-csv : memory_limit=2G, display_errors=On, error_reporting=-1
107
- pecl : false
67
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
68
+
69
+ - name : Get composer cache directory
70
+ id : composer-cache
71
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
72
+
73
+ - name : Cache composer dependencies
74
+ uses : actions/cache@v2
75
+ with :
76
+ path : ${{ steps.composer-cache.outputs.dir }}
77
+ key : composer-${{ hashFiles('**/composer.lock') }}
78
+ restore-keys : composer-
79
+
80
+ - name : Install Composer dependencies
81
+ run : |
82
+ composer install --no-progress --prefer-dist --optimize-autoloader
83
+
108
84
- name : Run PHPUnit
109
- continue-on-error : true
110
- run : php tools/phpunit
85
+ run : php vendor/bin/phpunit
111
86
112
87
codestyle :
113
88
runs-on : ubuntu-latest
114
- needs : [setup, phpunit]
115
89
steps :
116
- - uses : actions/checkout@master
90
+ - uses : actions/checkout@v2
117
91
- name : Restore/cache vendor folder
118
92
uses : actions/cache@v1
119
93
with :
@@ -139,54 +113,63 @@ jobs:
139
113
140
114
phpstan :
141
115
runs-on : ubuntu-latest
142
- needs : [setup, phpunit]
143
116
steps :
144
- - uses : actions/checkout@master
145
- - name : Restore/cache vendor folder
146
- uses : actions/cache@v1
117
+ - uses : actions/checkout@v2
118
+ - name : Setup PHP
119
+ uses : shivammathur/setup-php@v2
147
120
with :
148
- path : vendor
149
- key : all-build-${{ hashFiles('**/composer.lock') }}
150
- restore-keys : |
151
- all-build-${{ hashFiles('**/composer.lock') }}
152
- all-build-
153
- - name : Restore/cache tools folder
154
- uses : actions/cache@v1
121
+ php-version : ${{ env.defaultPHPVersion }}
122
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
123
+ tools : pecl
124
+
125
+ - name : Get composer cache directory
126
+ id : composer-cache
127
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
128
+
129
+ - name : Cache composer dependencies
130
+ uses : actions/cache@v2
155
131
with :
156
- path : tools
157
- key : all-tools-${{ github.sha }}
158
- restore-keys : |
159
- all-tools-${{ github.sha }}-
160
- all-tools-
132
+ path : ${{ steps.composer-cache.outputs.dir }}
133
+ key : composer-${{ hashFiles('**/composer.lock') }}
134
+ restore-keys : composer-
135
+
136
+ - name : Install Composer dependencies
137
+ run : |
138
+ composer install --no-progress --prefer-dist --optimize-autoloader
139
+
161
140
- name : PHPStan
162
- uses : docker://phpdoc/ phpstan-ga:0.12
141
+ uses : phpDocumentor/ phpstan-ga@master
163
142
env :
164
143
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
165
144
with :
166
- args : analyse src tests --level max -- configuration phpstan.neon
145
+ args : analyse src tests --configuration phpstan.neon
167
146
168
147
psalm :
169
148
runs-on : ubuntu-latest
170
- needs : [setup, phpunit]
171
149
steps :
172
- - uses : actions/checkout@master
173
- - name : Restore/cache vendor folder
174
- uses : actions/cache@v1
150
+ - uses : actions/checkout@v2
151
+
152
+ - name : Setup PHP
153
+ uses : shivammathur/setup-php@v2
175
154
with :
176
- path : vendor
177
- key : all-build-${{ hashFiles('**/composer.lock') }}
178
- restore-keys : |
179
- all-build-${{ hashFiles('**/composer.lock') }}
180
- all-build-
181
- - name : Restore/cache tools folder
182
- uses : actions/cache@v1
155
+ php-version : 7.3
156
+ ini-values : memory_limit=2G, display_errors=On, error_reporting=-1
157
+ tools : pecl, psalm
158
+
159
+ - name : Get composer cache directory
160
+ id : composer-cache
161
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
162
+
163
+ - name : Cache composer dependencies
164
+ uses : actions/cache@v2
183
165
with :
184
- path : tools
185
- key : all-tools-${{ github.sha }}
186
- restore-keys : |
187
- all-tools-${{ github.sha }}-
188
- all-tools-
166
+ path : ${{ steps.composer-cache.outputs.dir }}
167
+ key : composer-${{ hashFiles('**/composer.lock') }}
168
+ restore-keys : composer-
169
+
170
+ - name : Install Composer dependencies
171
+ run : |
172
+ composer install --no-progress --prefer-dist --optimize-autoloader
173
+
189
174
- name : Psalm
190
- uses : docker://mickaelandrieu/psalm-ga
191
- env :
192
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
175
+ run : psalm --output-format=github
0 commit comments