-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.travis.yml
86 lines (75 loc) · 2.44 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
language: php
dist: trusty
sudo: false
addons:
apt:
packages:
- gdb
cache:
directories:
- ${HOME}/.cache/pip
- ${HOME}/.composer/cache/files
- ${HOME}/php-ext
env:
global:
- DRIVER_VERSION=1.5.2
- SERVER_VERSION=4.0.0
- DB_URI=mongodb://localhost:27017,localhost:27018,localhost:27019
- DB_REPLICA_SET=repl0
- DB_NAME=event_store_tests
matrix:
fast_finish: true
include:
- php: 7.1
- php: 7.2
before_install:
- mkdir -p "$HOME/tmp"
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${SERVER_VERSION}.tgz
- tar zxf mongodb-linux-x86_64-${SERVER_VERSION}.tgz
- export PATH=${PWD}/mongodb-linux-x86_64-${SERVER_VERSION}/bin/:${PATH}
- mongod --version
- |
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# tpecl is a helper to compile and cache php extensions
tpecl () {
local ext_name=$1
local ext_so=$2
local ext_dir=$(php -r "echo ini_get('extension_dir');")
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
if [[ -e $ext_cache/$ext_so ]]; then
echo extension = $ext_cache/$ext_so >> $INI
else
mkdir -p $ext_cache
echo yes | pecl install -f $ext_name &&
cp $ext_dir/$ext_so $ext_cache
fi
}
export -f tpecl
before_script:
- mkdir -p "$HOME/.php-cs-fixer"
- ${TRAVIS_BUILD_DIR}/.travis/init.sh
- tpecl mongodb-${DRIVER_VERSION} mongodb.so
- php --ri mongodb
- composer install --no-interaction --no-progress --no-suggest
- ulimit -c
- ulimit -c unlimited -S
script:
- cp phpunit.xml.dist phpunit.xml
- if [[ $TEST_COVERAGE == 'true' ]]; then php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml; else ./vendor/bin/phpunit; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi
before_cache:
- rm -f ${HOME}/.cache/pip/log/debug.log
after_success:
- if [[ $TEST_COVERAGE == 'true' ]]; then php vendor/bin/coveralls -v; fi
after_script:
- ${TRAVIS_BUILD_DIR}/.travis/stop.sh
- cat ${TRAVIS_BUILD_DIR}/log1.log
- cat ${TRAVIS_BUILD_DIR}/log2.log
- cat ${TRAVIS_BUILD_DIR}/log3.log
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/61c75218816eebde4486
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always