-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
63 lines (56 loc) · 1.9 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
language: php
cache:
directories:
- vendor/
before_install:
# Disable xdebug if php version != 7.2 (only use xdebug for reports)
- if [[ $ENABLE_CODE_COVERAGE == false ]]; then phpenv config-rm xdebug.ini; fi
# Enable mongo/mongodb extension regarding php version
- echo "extension = ${MONGO_EXT_NAME}.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "php ext-${MONGO_EXT_NAME} extension enabled."
# Require alcaeus/mongo-php-adapter for php >= 7 tests
- if [[ $TRAVIS_PHP_VERSION == 7.* ]]; then composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter; fi
# Require doctine collections/orm/mongodb to launch ALL tests
- composer require doctrine/collections:">=1.0" doctrine/orm:">=2.0" doctrine/mongodb:">=1.0"
env:
global:
- MONGO_EXT_NAME=mongo
- ENABLE_CODE_COVERAGE=false
before_script:
- composer install
script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml
after_success:
- if [[ $ENABLE_CODE_COVERAGE ]]; then bash <(curl -s https://codecov.io/bash); fi
matrix:
include:
#===== TESTS
- php: '5.3'
dist: precise
- php: '5.4'
- php: '5.5'
- php: '5.6'
- php: '7.0'
env:
- MONGO_EXT_NAME=mongodb
- php: '7.1'
env:
- MONGO_EXT_NAME=mongodb
- php: '7.2'
env:
- MONGO_EXT_NAME=mongodb
- ENABLE_CODE_COVERAGE=true
#===== CODE INSPECTION
- stage: 'code-inspection'
php: '7.2'
env: ''
before_install: ''
before_script:
- composer require phpmd/phpmd:"@stable" squizlabs/php_codesniffer:"@stable"
- composer install
install: skip
script:
- ./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
- ./vendor/bin/phpcs --standard=PSR1 src/
- ./vendor/bin/phpcs --standard=PSR2 src/
# - ./vendor/bin/phpmd src/ text codesize,unusedcode,naming,design,cleancode