forked from doctrine/mongodb-odm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (65 loc) · 2.63 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
dist: trusty
sudo: required
language: php
# Note: latest PHP version is tested with coverage; lowest is tested with --prefer-lowest
php:
- 7.1
- 7.2
env:
global:
- DOCTRINE_MONGODB_SERVER="mongodb://localhost:27017"
- KEY_SERVER="hkp://keyserver.ubuntu.com:80"
- MONGO_REPO_URI="https://repo.mongodb.org/apt/ubuntu"
- MONGO_REPO_TYPE="precise/mongodb-org/"
- SOURCES_LOC="/etc/apt/sources.list.d/mongodb.list"
- DRIVER_VERSION="stable"
matrix:
- SERVER_VERSION="3.2" KEY_ID="EA312927"
- SERVER_VERSION="3.4" KEY_ID="0C49F3730359A14518585931BC711F9BA15703C6"
- SERVER_VERSION="3.6" KEY_ID="2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
jobs:
include:
# Test against lowest dependencies, including driver and server versions
- stage: Test
php: 7.1
env: SERVER_VERSION="3.2" KEY_ID="EA312927" DRIVER_VERSION="1.3.0"
install:
- composer update --prefer-lowest
# Run tests with coverage
- stage: Code Quality
php: 7.2
env: COVERAGE SERVER_VERSION="3.6" KEY_ID="2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
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
script:
- vendor/bin/phpunit --coverage-clover=coverage.clover
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- stage: Code Quality
php: 7.1
env: STATIC_ANALYSIS SERVER_VERSION="3.6" KEY_ID="2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
script:
- vendor/bin/phpstan analyse -l 1 lib
- stage: Code Quality
php: 7.1
env: CODING_STANDARDS SERVER_VERSION="3.6" KEY_ID="2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
script:
- vendor/bin/phpcs
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- sudo apt-key adv --keyserver ${KEY_SERVER} --recv ${KEY_ID}
- echo "deb ${MONGO_REPO_URI} ${MONGO_REPO_TYPE}${SERVER_VERSION} multiverse" | sudo tee ${SOURCES_LOC}
- sudo apt-get update -qq
- sudo apt-get --allow-unauthenticated install mongodb-org
- if nc -z localhost 27017; then sudo service mongod stop; fi
- sudo pip install mongo-orchestration
- sudo mongo-orchestration start
- curl -XPUT http://localhost:8889/v1/sharded_clusters/myCluster --data @tests/sharded.json
- pecl install -f mongodb-${DRIVER_VERSION}
- composer self-update
install:
- composer update
script:
- vendor/bin/phpunit