14
14
15
15
runs-on : " ubuntu-latest"
16
16
17
+ strategy :
18
+ matrix :
19
+ php-version :
20
+ - " 7.1"
21
+
17
22
steps :
18
23
- name : " Checkout"
19
24
@@ -25,6 +30,115 @@ jobs:
25
30
file_or_dir : " ."
26
31
strict : true
27
32
33
+ - name : " Install PHP with extensions"
34
+ uses : " shivammathur/setup-php@v2"
35
+ with :
36
+ coverage : " none"
37
+ extensions : " ${{ env.PHP_EXTENSIONS }}"
38
+ php-version : " ${{ matrix.php-version }}"
39
+
40
+ - name : " Validate composer.json and composer.lock"
41
+ run : " composer validate --strict"
42
+
43
+ - name : " Run ergebnis/composer-normalize"
44
+ run : " tools/composer-normalize --dry-run"
45
+
46
+ - name : " Create cache directory for friendsofphp/php-cs-fixer"
47
+ run : " mkdir -p .build/php-cs-fixer"
48
+
49
+ - name : " Cache cache directory for friendsofphp/php-cs-fixer"
50
+ uses : " actions/cache@v2"
51
+ with :
52
+ path : " .build/php-cs-fixer"
53
+ key : " php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('tools/php-cs-fixer') }}"
54
+ restore-keys : " php-${{ matrix.php-version }}-php-cs-fixer-"
55
+
56
+ - name : " Run friendsofphp/php-cs-fixer"
57
+ run : " tools/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"
58
+
59
+ static-code-analysis :
60
+ name : " Static Code Analysis"
61
+
62
+ runs-on : " ubuntu-latest"
63
+
64
+ strategy :
65
+ matrix :
66
+ php-version :
67
+ - " 7.4"
68
+
69
+ dependencies :
70
+ - " highest"
71
+
72
+ steps :
73
+ - name : " Checkout"
74
+
75
+
76
+ - name : " Install PHP with extensions"
77
+ uses : " shivammathur/setup-php@v2"
78
+ with :
79
+ coverage : " none"
80
+ php-version : " ${{ matrix.php-version }}"
81
+
82
+ - name : " Determine composer cache directory"
83
+ id : " determine-composer-cache-directory"
84
+ run : " echo \" ::set-output name=directory::$(composer config cache-dir)\" "
85
+
86
+ - name : " Cache dependencies installed with composer"
87
+ uses : " actions/cache@v2"
88
+ with :
89
+ path : " ${{ steps.determine-composer-cache-directory.outputs.directory }}"
90
+ key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
91
+ restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
92
+
93
+ - name : " Install lowest dependencies from composer.json"
94
+ if : " matrix.dependencies == 'lowest'"
95
+ run : " composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
96
+
97
+ - name : " Install locked dependencies from composer.lock"
98
+ if : " matrix.dependencies == 'locked'"
99
+ run : " composer install --no-interaction --no-progress --no-suggest"
100
+
101
+ - name : " Install highest dependencies from composer.json"
102
+ if : " matrix.dependencies == 'highest'"
103
+ run : " composer update --no-interaction --no-progress --no-suggest"
104
+
105
+ - name : " Create cache directory for vimeo/psalm"
106
+ run : " mkdir -p .build/psalm"
107
+
108
+ - name : " Cache cache directory for vimeo/psalm"
109
+ uses : " actions/cache@v2"
110
+ with :
111
+ path : " .build/psalm"
112
+ key : " php-${{ matrix.php-version }}-psalm-${{ github.sha }}"
113
+ restore-keys : " php-${{ matrix.php-version }}-psalm-"
114
+
115
+ - name : " Run vimeo/psalm"
116
+ run : " tools/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --threads=4"
117
+
118
+ backward-compatibility :
119
+ name : " Backward Compatibility"
120
+
121
+ runs-on : " ubuntu-latest"
122
+
123
+ steps :
124
+ - name : " Checkout"
125
+
126
+ with :
127
+ fetch-depth : 0
128
+
129
+ - name : " Fetch tags"
130
+ run : " git fetch --depth=1 origin +refs/tags/*:refs/tags/*"
131
+
132
+ - name : " Install PHP with extensions"
133
+ uses : " shivammathur/setup-php@v2"
134
+ with :
135
+ php-version : " 7.4"
136
+ coverage : " none"
137
+ extensions : " intl"
138
+
139
+ - name : " Run roave/backward-compatibility-check"
140
+ run : " tools/roave-backward-compatibility-check --from=1.0.0"
141
+
28
142
tests :
29
143
name : " Tests"
30
144
@@ -36,8 +150,11 @@ jobs:
36
150
- " 7.1"
37
151
- " 7.2"
38
152
- " 7.3"
153
+ - " 7.4"
154
+ - " 8.0"
39
155
40
156
dependencies :
157
+ - " lowest"
41
158
- " highest"
42
159
43
160
steps :
@@ -76,12 +193,71 @@ jobs:
76
193
- name : " Run tests with phpunit/phpunit"
77
194
run : " vendor/bin/phpunit --configuration=phpunit.xml"
78
195
196
+ code-coverage :
197
+ name : " Code Coverage"
198
+
199
+ runs-on : " ubuntu-latest"
200
+
201
+ strategy :
202
+ matrix :
203
+ php-version :
204
+ - " 7.4"
205
+
206
+ dependencies :
207
+ - " highest"
208
+
209
+ steps :
210
+ - name : " Checkout"
211
+
212
+
213
+ - name : " Install PHP with extensions"
214
+ uses : " shivammathur/setup-php@v2"
215
+ with :
216
+ coverage : " pcov"
217
+ extensions : " ${{ env.PHP_EXTENSIONS }}"
218
+ php-version : " ${{ matrix.php-version }}"
219
+
220
+ - name : " Determine composer cache directory"
221
+ id : " determine-composer-cache-directory"
222
+ run : " echo \" ::set-output name=directory::$(composer config cache-dir)\" "
223
+
224
+ - name : " Cache dependencies installed with composer"
225
+ uses : " actions/cache@v2"
226
+ with :
227
+ path : " ${{ steps.determine-composer-cache-directory.outputs.directory }}"
228
+ key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
229
+ restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
230
+
231
+ - name : " Install lowest dependencies from composer.json"
232
+ if : " matrix.dependencies == 'lowest'"
233
+ run : " composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
234
+
235
+ - name : " Install locked dependencies from composer.lock"
236
+ if : " matrix.dependencies == 'locked'"
237
+ run : " composer install --no-interaction --no-progress --no-suggest"
238
+
239
+ - name : " Install highest dependencies from composer.json"
240
+ if : " matrix.dependencies == 'highest'"
241
+ run : " composer update --no-interaction --no-progress --no-suggest"
242
+
243
+ - name : " Collect code coverage with pcov and phpunit/phpunit"
244
+ run : " vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/logs/clover.xml"
245
+
246
+ - name : " Send code coverage report to Codecov.io"
247
+ env :
248
+ CODECOV_TOKEN : " ${{ secrets.CODECOV_TOKEN }}"
249
+ run : " bash <(curl -s https://codecov.io/bash)"
250
+
79
251
merge :
80
252
name : " Merge"
81
253
82
254
runs-on : " ubuntu-latest"
83
255
84
256
needs :
257
+ - " backward-compatibility"
258
+ - " code-coverage"
259
+ - " coding-standards"
260
+ - " static-code-analysis"
85
261
- " tests"
86
262
87
263
if : >
0 commit comments