-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
55 lines (48 loc) · 2.26 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
sudo: required
language: php
env:
- TAG=5.4
- TAG=5.5
- TAG=5.6
- TAG=7.0
- TAG=7.1
services:
- docker
before_install:
# - sudo apt-get update -qq
# - sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install docker-engine=17.03.0~ce-0~ubuntu-trusty
- docker -v
- travis_retry docker network create php_cli_net
- travis_retry docker run --name couchbase -d --net php_cli_net couchbase/server:community-4.1.0
- travis_retry docker run --name redis -d --net php_cli_net -e 'REDIS_PASSWORD=testpass' romeoz/docker-redis:4.0
- |
if [[ $TAG = 5.4 ]]; then
travis_retry docker run --name memcached -d --net php_cli_net romeoz/docker-memcached:1.4.22
else
travis_retry docker run --name memcached -d --net php_cli_net romeoz/docker-memcached
fi
- travis_retry docker run --name mongodb -d --net php_cli_net romeoz/docker-mongodb:2.6 --smallfiles --noprealloc
- travis_retry docker run --name rock_cache -d -e TRAVIS=$TRAVIS -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID --net php_cli_net -v $(pwd):/var/www romeoz/docker-phpfpm:$TAG'-full'
- docker ps -a
install:
- chmod -R +x tests/data/travis/
- travis_retry docker exec -it couchbase bash -c '/opt/couchbase/bin/couchbase-cli bucket-create -c 127.0.0.1:8091 --bucket=default --bucket-type=memcached --bucket-ramsize=64 --enable-flush=1 -u demo -p demo'
- tests/data/travis/mongodb-setup.sh
- docker exec -it rock_cache bash -c 'composer --version && exit $?'
- travis_retry docker exec -it rock_cache bash -c 'composer install --prefer-dist && exit $?'
- |
if [[ $TAG = 5.6 ]]; then
travis_retry docker exec -it rock_cache bash -c 'apt-get update && apt-get install -y git'
travis_retry docker exec -it rock_cache bash -c 'composer require satooshi/php-coveralls:^2.0 --dev && mkdir -p build/logs'
fi
script:
- |
if [[ $TAG = 5.6 ]]; then
PHPUNIT_FLAGS="--coverage-clover=build/logs/clover.xml"
fi
- travis_retry docker exec -it rock_cache bash -c 'phpunit --bootstrap tests/bootstrap.php --configuration ./phpunit.xml.dist --verbose $PHPUNIT_FLAGS --exclude-group hhvm || exit 0'
after_script:
- |
if [[ $TAG = 5.6 ]]; then
travis_retry docker exec -it rock_cache bash -c 'vendor/bin/php-coveralls -v && exit $?'
fi