-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
274 lines (230 loc) · 8.72 KB
/
tests.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: Tests
on: [ pull_request, push ]
jobs:
ubuntu:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.6-alpine
ports:
- 11211:11211
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: forge
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:5.0
ports:
- 6379:6379
options: --entrypoint redis-server
dynamodb:
image: amazon/dynamodb-local:latest
ports:
- 8888:8000
strategy:
fail-fast: false
matrix:
include:
- php: 7.1.8
- php: 7.1.28
- php: 7.1
- php: 7.1
setup: lowest
- php: 7.2.0
- php: 7.2.15
- php: 7.2
- php: 7.2
setup: lowest
- php: 7.3.0
- php: 7.3.5
- php: 7.3
- php: 7.3
setup: lowest
- php: 7.4
- php: 7.4
setup: lowest
- php: 8.0
classmap-authoritative: true
- php: 8.0
- php: 8.0
setup: lowest
- php: 8.1
- php: 8.1
setup: lowest
- php: 8.2
- php: 8.2
setup: lowest
- php: 8.3
- php: 8.3
setup: lowest
- php: 8.1
laravel: true
reference: 10.x
- php: 8.1
laravel: true
reference: 10.x
classmap-authoritative: true
- php: 8.2
laravel: true
reference: master
- php: 8.2
laravel: true
reference: master
classmap-authoritative: true
- php: 8.2
coverage: true
name: ${{ matrix.laravel && 'Laravel compatibility - ' || '' }}${{ matrix.classmap-authoritative && 'classmap-authoritative - ' || '' }}${{ matrix.coverage && 'Coverage - ' || '' }}PHP ${{ matrix.php }} - ${{ matrix.setup || 'stable' }} - ubuntu
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, msgpack${{ matrix.laravel && ', dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis-phpredis/[email protected], igbinary, msgpack, lzf, zstd, lz4, memcached, gmp' || '' }}
ini-values: error_reporting=${{ (matrix.setup != 'lowest') && '32767' || '8191' }}
tools: composer:v2
coverage: ${{ matrix.coverage && 'pcov' || 'none' }}
env:
REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4
REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev
- name: Install locales
run: |
sudo apt-get update || apt --fix-broken install || echo 'Apt failure ignored'
sudo apt-get install tzdata locales -y && sudo locale-gen fr_FR.UTF-8 sr_ME.UTF-8 ar_AE.UTF-8 zh_TW.UTF-8 zh_CN.UTF-8 yo_NG.UTF-8 en_US.UTF-8 || echo 'Apt failure ignored'
- name: Set Minimum PHP 8.1 Versions
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
if: matrix.laravel
- name: Get composer cache directory
id: composer-cache-ubuntu
run: echo "dir=$(composer config cache-files-dir)" > $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache-ubuntu.outputs.dir }}
key: "php-${{ matrix.php }}-${{ matrix.setup }}-ubuntu-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-${{ matrix.setup }}-ubuntu-${{ hashFiles('**/composer.json') }}"
- name: Install dependencies
uses: nick-fields/retry@v2
if: steps.composer-cache.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 3
command: |
composer remove --no-update phpmd/phpmd friendsofphp/php-cs-fixer --no-interaction --dev;
if [[ "${{ matrix.laravel }}" != 'true' ]]; then
composer remove --no-update kylekatarnls/multi-tester --no-interaction --dev;
fi;
${{ matrix.php >= 8.1 && 'composer require --no-update phpunit/phpunit:^9.5.20 --no-interaction --dev;' || '' }}
composer update --prefer-dist --no-progress --prefer-${{ matrix.setup || 'stable' }} ${{ matrix.classmap-authoritative && '--classmap-authoritative' || '' }}${{ matrix.php >= 8.2 && ' --ignore-platform-reqs' || '' }};
- name: Run test suite
run: |
if [[ "${{ matrix.laravel }}" != 'true' && "${{ matrix.coverage }}" = 'true' ]]; then
php -d memory_limit=-1 -d zend.enable_gc=0 -d error_reporting=-1 vendor/phpunit/phpunit/phpunit --coverage-clover=clover.xml --coverage-text;
fi;
if [[ "${{ matrix.laravel }}" != 'true' && "${{ matrix.coverage }}" != 'true' ]]; then
php -d memory_limit=-1 -d zend.enable_gc=0 -d error_reporting=-1 vendor/phpunit/phpunit/phpunit;
fi;
if [[ "${{ matrix.laravel }}" = 'true' ]]; then
vendor/bin/multi-tester tests/Laravel/laravel-${{ matrix.reference }}.multi-tester.yml;
fi;
env:
PHP_VERSION: ${{ matrix.php }}
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
- name: Code Climate Test Reporter
if: matrix.coverage
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build -t clover
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
continue-on-error: true
- name: Coverage
uses: codecov/codecov-action@v3
if: matrix.coverage
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- php: 7.1.8
- php: 7.1.28
- php: 7.1
- php: 7.1
setup: lowest
- php: 7.2.0
- php: 7.2.15
- php: 7.2
- php: 7.2
setup: lowest
- php: 7.3.0
- php: 7.3.5
- php: 7.3
- php: 7.3
setup: lowest
- php: 7.4
coverage: true
- php: 7.4
setup: lowest
- php: 8.0
- php: 8.0
setup: lowest
- php: 8.1
- php: 8.1
setup: lowest
- php: 8.2
- php: 8.2
setup: lowest
- php: 8.3
- php: 8.3
setup: lowest
name: PHP ${{ matrix.php }} - ${{ matrix.setup || 'stable' }} - windows
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
tools: composer:v2
coverage: none
- name: Get composer cache directory
id: composer-cache-windows
shell: bash
run: echo "dir=$(composer config cache-files-dir)" > $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache-windows.outputs.dir }}
key: "php-${{ matrix.php }}-${{ matrix.setup }}-windows-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-${{ matrix.setup }}-windows-${{ hashFiles('**/composer.json') }}"
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
composer remove --no-update kylekatarnls/multi-tester phpmd/phpmd friendsofphp/php-cs-fixer --no-interaction --dev;
${{ matrix.php >= 8.1 && 'composer require --no-update phpunit/phpunit:^9.5.20 --no-interaction --dev;' || '' }}
composer update --prefer-dist --no-progress --prefer-${{ matrix.setup || 'stable' }}${{ matrix.php >= 8.2 && ' --ignore-platform-reqs' || '' }};
- name: Run test suite
run: |
php -d memory_limit=-1 -d zend.enable_gc=0 -d error_reporting=-1 vendor/phpunit/phpunit/phpunit;
env:
PHP_VERSION: ${{ matrix.php }}
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379