forked from doctrine/mongodb-odm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
92 lines (80 loc) · 2.58 KB
/
.travis.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
dist: xenial
sudo: required
language: php
# Note: latest PHP version is tested with coverage; lowest is tested with --prefer-lowest
php:
- 7.2
- 7.3
- 7.4snapshot
env:
global:
- DEPLOYMENT=STANDALONE
- DRIVER_VERSION="stable"
- ADAPTER_VERSION="^1.0.0"
- SERVER_DISTRO=ubuntu1604
- SERVER_VERSION=4.2.0
matrix:
- SERVER_VERSION="3.0.15"
- SERVER_VERSION="3.2.22"
- SERVER_VERSION="3.4.23"
- SERVER_VERSION="3.6.14"
- SERVER_VERSION="4.0.12"
- SERVER_VERSION="4.2.0"
jobs:
include:
# Test against lowest dependencies, including driver and server versions
- stage: Test
php: 7.2
env: DRIVER_VERSION="1.5.0" COMPOSER_FLAGS="--prefer-lowest" SERVER_VERSION="3.0.15"
# Test sharded cluster functionality
- stage: Test
php: 7.3
env: DEPLOYMENT=SHARDED_CLUSTER_RS
script:
- ./vendor/bin/phpunit --group=sharding
# Test on replica sets
- stage: Test
php: 7.3
env: DEPLOYMENT=REPLICASET
# Run tests with coverage
- stage: Code Quality
php: 7.2
env: DEPLOYMENT=SHARDED_CLUSTER_RS
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
- vendor/bin/phpunit --dump-xdebug-filter xdebug-filter.php
script:
- export DOCTRINE_MONGODB_SERVER=`cat /tmp/uri.txt`
- echo $DOCTRINE_MONGODB_SERVER
- vendor/bin/phpunit --prepend xdebug-filter.php --coverage-clover=coverage.clover
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
# Check coding standards
- stage: Code Quality
php: 7.2
script:
- vendor/bin/phpstan analyse
- stage: Code Quality
php: 7.2
script:
- vendor/bin/phpcs
# Performance tests
- stage: Performance
php: 7.3
script: vendor/bin/phpbench run --report=default --revs=100 --iterations=5 --report=aggregate
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
install:
- .travis/setup_mongodb.sh
- sudo pip install mongo-orchestration
- sudo mongo-orchestration start
- .travis/setup_mo.sh
- composer self-update
- pecl install -f mongodb-${DRIVER_VERSION}
- composer update ${COMPOSER_FLAGS}
- export DOCTRINE_MONGODB_SERVER=`cat /tmp/uri.txt`
- echo $DOCTRINE_MONGODB_SERVER
script:
- ./vendor/bin/phpunit