This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
config.yml
331 lines (309 loc) · 9.28 KB
/
config.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
unit-config: &unit-config
environment:
TEST_PHP_ARGS: -q
REPORT_EXIT_STATUS: 1
RUN_EXTENSION_TESTS: 1
SUDO_CMD: "sudo"
steps:
- checkout
- run:
name: Install build tools
command: |
autoconf -V || \
(
$SUDO_CMD apt-get update -y && \
$SUDO_CMD apt-get install -y -q --no-install-recommends \
build-essential \
g++ \
gcc \
libc-dev \
make \
autoconf \
git \
unzip
)
- run:
name: Extension unit tests
command: |
if [ $RUN_EXTENSION_TESTS -eq "1" ]; then
pushd ext
phpize
./configure --enable-opencensus
make test || ((find . -name '*.diff' | xargs cat) && false)
$SUDO_CMD make install
popd
else
echo "Skipping extension tests"
fi
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install composer packages
command: composer install -n --prefer-dist
- save_cache:
paths:
- ./vendor
key: v1-dependencies-{{ checksum "composer.json" }}
- run:
name: Enable E_ALL error reporting for strict testing
command: $SUDO_CMD cp config/php.ini /usr/local/etc/php
- run:
name: PHP Code Style
command: vendor/bin/phpcs --standard=./phpcs-ruleset.xml
- run:
name: PHP unit tests
command: XDEBUG_MODE=coverage vendor/bin/phpunit
- run:
name: PHP unit tests with extension
command: |
if [ $RUN_EXTENSION_TESTS -eq "1" ]; then
XDEBUG_MODE=coverage php -d extension=opencensus.so vendor/bin/phpunit
else
echo "Skipping units tests with extension"
fi
version: 2
jobs:
php71:
<<: *unit-config
docker:
- image: circleci/php:7.1-node
php71-zts:
<<: *unit-config
docker:
- image: circleci/php:7.1-zts-node
php72:
<<: *unit-config
docker:
- image: circleci/php:7.2-node
php72-zts:
<<: *unit-config
docker:
- image: circleci/php:7.2-zts-node
php73:
<<: *unit-config
docker:
- image: circleci/php:7.3-node
php73-zts:
<<: *unit-config
docker:
- image: circleci/php:7.3-zts-node
php74:
<<: *unit-config
docker:
- image: circleci/php:7.4-node
php74-zts:
<<: *unit-config
docker:
- image: circleci/php:7.4-zts-node
php80:
<<: *unit-config
docker:
- image: circleci/php:8.0-node
php80-zts:
<<: *unit-config
docker:
- image: circleci/php:8.0-zts-node
# Integration tests running on PHP 7.4. When updating these, please also update `integration-8.0` further down.
integration-7.4:
docker:
- image: circleci/php:7.4-node
- image: memcached
- image: mysql:5.7
environment:
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: mysqldb
MYSQL_RANDOM_ROOT_PASSWORD: yes
- image: postgres:9.6
environment:
POSTGRES_PASSWORD: pgsql
POSTGRES_USER: postgres
steps:
- checkout
- run:
name: Install build tools
command: |
sudo apt-get update -y
sudo apt-get install -y -q --no-install-recommends \
build-essential \
g++ \
gcc \
libc-dev \
libpqxx-dev \
make \
autoconf \
git \
unzip
- run:
name: Install opencensus extension
command: |
cd ext
phpize
./configure --enable-opencensus
sudo make install
sudo docker-php-ext-enable opencensus
- run:
name: Install memcached extension
command: |
sudo apt-get install -y -q --no-install-recommends \
libmemcached11 libmemcached-dev zlib1g-dev zlib1g
sudo pecl install memcached <<<''
sudo docker-php-ext-enable memcached
- run:
name: Install pdo_mysql extension
command: sudo docker-php-ext-install pdo_mysql
- run:
name: Install mysqli extension
command: sudo docker-php-ext-install mysqli
- run:
name: Install pgsql extension
command: sudo docker-php-ext-install pgsql
- run:
name: Install pcntl extension
command: sudo docker-php-ext-install pcntl
- run:
name: Curl test
command: tests/integration/curl/test.sh
- run:
name: Guzzle 5 test
command: tests/integration/guzzle5/test.sh
- run:
name: Guzzle 6 test
command: tests/integration/guzzle6/test.sh
- run:
name: Laravel test
command: tests/integration/laravel/test.sh
- run:
name: Memcached test
command: tests/integration/memcached/test.sh
- run:
name: Pgsql test
command: tests/integration/pgsql/test.sh
# Skipped due to a dependency incompatibility between "cache/adapter-common" and "psr/cache".
# TODO(mrmage): Re-enable this step once "cache/adapter-common" supports "psr/cache" v2.0/v3.0.
# - run:
# name: Symfony 4 test
# command: tests/integration/symfony4/test.sh
# environment:
# DATABASE_URL: mysql://mysql:[email protected]:3306/mysqldb
- run:
name: Wordpress test
command: tests/integration/wordpress/test.sh
environment:
DB_HOST: 127.0.0.1
DB_USERNAME: mysql
DB_PASSWORD: mysql
DB_DATABASE: mysqldb
# Integration tests running on PHP 8.0. When updating these, please also update `integration-7.4` further down.
integration-8.0:
docker:
- image: circleci/php:8.0-node
- image: memcached
- image: mysql:5.7
environment:
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: mysqldb
MYSQL_RANDOM_ROOT_PASSWORD: yes
- image: postgres:9.6
environment:
POSTGRES_PASSWORD: pgsql
POSTGRES_USER: postgres
steps:
- checkout
- run:
name: Install build tools
command: |
sudo apt-get update -y
sudo apt-get install -y -q --no-install-recommends \
build-essential \
g++ \
gcc \
libc-dev \
libpqxx-dev \
make \
autoconf \
git \
unzip
- run:
name: Install opencensus extension
command: |
cd ext
phpize
./configure --enable-opencensus
sudo make install
sudo docker-php-ext-enable opencensus
- run:
name: Install memcached extension
command: |
sudo apt-get install -y -q --no-install-recommends \
libmemcached11 libmemcached-dev zlib1g-dev zlib1g
sudo pecl install memcached <<<''
sudo docker-php-ext-enable memcached
- run:
name: Install pdo_mysql extension
command: sudo docker-php-ext-install pdo_mysql
- run:
name: Install mysqli extension
command: sudo docker-php-ext-install mysqli
- run:
name: Install pgsql extension
command: sudo docker-php-ext-install pgsql
- run:
name: Install pcntl extension
command: sudo docker-php-ext-install pcntl
- run:
name: Curl test
command: tests/integration/curl/test.sh
- run:
name: Guzzle 5 test
command: tests/integration/guzzle5/test.sh
- run:
name: Guzzle 6 test
command: tests/integration/guzzle6/test.sh
- run:
name: Laravel test
command: tests/integration/laravel/test.sh
- run:
name: Memcached test
command: tests/integration/memcached/test.sh
- run:
name: Pgsql test
command: tests/integration/pgsql/test.sh
# Skipped due to a dependency incompatibility between "cache/adapter-common" and "psr/cache".
# TODO(mrmage): Re-enable this step once "cache/adapter-common" supports "psr/cache" v2.0/v3.0.
# - run:
# name: Symfony 4 test
# command: tests/integration/symfony4/test.sh
# environment:
# DATABASE_URL: mysql://mysql:[email protected]:3306/mysqldb
# Skipped because "wp-cli" is currently not compatible with PHP 8 (see https://github.com/wp-cli/wp-cli/issues/5452).
# TODO(mrmage): Re-enable this step once "wp-cli" supports PHP 8.
# - run:
# name: Wordpress test
# command: tests/integration/wordpress/test.sh
environment:
DB_HOST: 127.0.0.1
DB_USERNAME: mysql
DB_PASSWORD: mysql
DB_DATABASE: mysqldb
workflows:
version: 2
units:
jobs:
- php71
- php71-zts
- php72
- php72-zts
- php73
- php73-zts
- php74
- php74-zts
- php80
- php80-zts
- integration-7.4
- integration-8.0