forked from rybakit/phive-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
133 lines (114 loc) · 3.78 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
language: php
matrix:
include:
- php: 5.4
- php: 5.5
- php: 5.6
- php: hhvm
allow_failures:
- php: hhvm
services:
- mongodb
- redis-server
before_install:
# gearman
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
sudo apt-get install python-software-properties;
sudo add-apt-repository -y ppa:gearman-developers/ppa;
fi
# tarantool (http://stable.tarantool.org/download.html)
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
wget http://tarantool.org/dist/public.key;
sudo apt-key add ./public.key;
release=`lsb_release -c -s`;
echo "deb http://tarantool.org/dist/stable/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list;
echo "deb-src http://tarantool.org/dist/stable/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list;
fi
- sudo apt-get update
install:
# gearman
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
sudo apt-get install gearman-job-server libgearman-dev;
pecl install gearman;
sudo service gearman-job-server stop;
sudo gearmand -d;
fi
# tarantool-lts
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
sudo apt-get install tarantool-lts tarantool-lts-client;
sudo wget https://raw.githubusercontent.com/tarantool/queue/stable/init.lua;
sudo wget https://raw.githubusercontent.com/tarantool/queue/stable/tarantool.cfg -O /etc/tarantool/instances.enabled/queue.cfg && echo "script_dir = "`pwd` | sudo tee -a /etc/tarantool/instances.enabled/queue.cfg;
sudo service tarantool-lts restart;
fi
#tarantool-php
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
git clone https://github.com/tarantool/tarantool-php.git;
cd ./tarantool-php;
git checkout stable;
phpize;
./configure;
make;
sudo make install;
cd ..;
fi
# beanstalk
- sudo apt-get install -y beanstalkd
- sudo beanstalkd -d -l 127.0.0.1 -p 11300
# uopz
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
pecl install uopz;
fi
# php.ini
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
printf "
extension = mongo.so\n
extension = redis.so\n
extension = tarantool.so\n
" >> ~/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/php.ini;
fi
before_script:
- mysql -e 'create database phive_tests;'
- psql -c 'create database phive_tests;' -U postgres
# Mongofill
- >
if [[ $TRAVIS_PHP_VERSION == hhvm* ]]; then
composer require mongofill/mongofill:dev-master;
fi
- composer install
# gearman workers
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
(php tests/worker.php >> worker.log &);
(php tests/worker.php >> worker.log &);
(php tests/worker.php >> worker.log &);
(php tests/worker.php >> worker.log &);
fi
script:
- >
if [[ $TRAVIS_PHP_VERSION == 5.6 ]]; then
phpunit --coverage-clover coverage.clover;
else
phpunit;
fi
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
phpunit --group concurrency;
fi
after_script:
- >
if [[ $TRAVIS_PHP_VERSION != hhvm* ]]; then
cat worker.log;
fi
# code-coverage for scrutinizer-ci
- >
if [[ -f coverage.clover ]]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;
fi