-
Notifications
You must be signed in to change notification settings - Fork 222
240 lines (192 loc) · 7.01 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: CI
on:
pull_request:
branches:
- "*.*"
- master
push:
branches:
- "*.*"
- master
env:
COMPOSER_ROOT_VERSION: "1.4"
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- php-version: 5.6
graphql-version: "^0.11.2"
composer-flags: "--prefer-lowest"
symfony-deprecation-helper: "disabled"
- php-version: 5.6
graphql-version: "0.12"
symfony-version: "3.1.*"
symfony-deprecation-helper: "disabled"
- php-version: 7.0
symfony-version: "3.2.*"
phpunit-version: "^5.7.26"
- php-version: 7.1
- php-version: 7.2
symfony-version: "3.4.*"
- php-version: 7.3
symfony-version: "4.1.*"
- php-version: 7.4
symfony-version: "4.3.*"
- php-version: 7.3
symfony-version: "4.4.*"
symfony-deprecation-helper: "max[total]=0"
- php-version: 7.3
symfony-version: "5.0.*"
symfony-deprecation-helper: "max[total]=0"
- php-version: 7.4
symfony-version: "5.1.*"
- php-version: 7.4
symfony-version: "5.2.*"
name: "PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }} Test"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 50
- name: "Install PHP without coverage"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Change stability"
if: matrix.stability != ''
run: perl -pi -e 's/^}$/,"minimum-stability":"'"${{ matrix.minimum-stability }}"'"}/' composer.json
- name: "Symfony version"
if: matrix.symfony-version != ''
run: perl -pi -e 's#"(symfony/.*)":\s*".*"#"$1":"'"${{ matrix.symfony-version }}"'"#' composer.json
- name: "PhpUnit version"
if: matrix.phpunit-version != ''
run: composer req "phpunit/phpunit:${{ matrix.phpunit-version }}" --dev --no-update
- name: "Webonyx GraphQL version"
if: matrix.graphql-version != ''
run: composer req "webonyx/graphql-php:${{ matrix.graphql-version }}" --dev --no-update
- name: "Install dependencies"
run: composer update --no-interaction --no-progress ${{ matrix.composer-flags }}
- name: "Set SYMFONY_DEPRECATIONS_HELPER if needed"
if: matrix.symfony-deprecation-helper != ''
run: export SYMFONY_DEPRECATIONS_HELPER=${{ matrix.symfony-deprecation-helper }}
- name: "Run tests"
run: composer test
coding-standard:
runs-on: ubuntu-16.04
name: Coding Standard
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 50
- name: "Install PHP without coverage"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.2"
coverage: "none"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Install dependencies"
run: composer update --no-interaction --no-progress
- name: "Check coding standard"
run: composer check-cs
benchmark:
runs-on: ubuntu-16.04
name: Benchmark
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 50
- name: "Install PHP without coverage"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.2"
coverage: "none"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Install dependencies"
run: composer update --no-interaction --no-progress
- name: "Run benchmark"
run: composer bench
static-analysis:
runs-on: ubuntu-16.04
name: "Static analysis"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 50
- name: "Install PHP with coverage"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.2"
coverage: "none"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Install dependencies"
run: composer update --no-interaction --no-progress
- name: "Run static-analysis"
run: composer static-analysis
coverage:
runs-on: ubuntu-16.04
name: "Coverage"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}
- name: "Install PHP with coverage"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.2"
ini-values: pcov.directory=.
coverage: "pcov"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Symfony 4.4 version"
run: perl -pi -e 's#"(symfony/.*)":\s*".*"#"$1":"'"4.4.*"'"#' composer.json
- name: "Install dependencies"
run: composer update --no-interaction --no-progress
- name: "Setup PCOV for PHPUnit < 8"
run: |
composer require pcov/clobber
bin/pcov clobber
- name: "Run tests with coverage"
run: bin/phpunit --color=always -v --debug --coverage-clover=build/logs/clover.xml
- name: "Upload coverage results to Scrutinizer"
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
- name: "Upload coverage results to Coveralls"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v