forked from phalcon/incubator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
109 lines (96 loc) · 3.66 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
# Phalcon Framework
#
# Copyright (c) 2011-2017 Phalcon Team (https://www.phalconphp.com)
#
# This source file is subject to the New BSD License that is bundled
# with this package in the file LICENSE.txt.
#
# If you did not receive a copy of the license and are unable to
# obtain it through the world-wide-web, please send an email
# to [email protected] so we can send you a copy immediately.
language: php
dist: trusty
sudo: required
php:
- 5.5
- 5.6
- 7.0
- 7.1
services:
- memcached
- redis
- mongodb
- mysql
git:
depth: 1
cache:
apt: true
ccache: true
timeout: 691200
directories:
- vendor
- $HOME/.composer/cache
- $HOME/pear
- $HOME/cphalcon
- $HOME/ext
env:
global:
- ZEND_DONT_UNLOAD_MODULES=1
- CC="ccache gcc"
- PATH="$PATH:~/bin"
- PHALCON_VERSION="v3.2.1"
before_install:
- export PHP_MAJOR="$(echo $TRAVIS_PHP_VERSION | cut -d '.' -f 1)"
- export PHP_EXTENSION_DIR=$(php-config --extension-dir)
- phpenv config-rm xdebug.ini || true
- bash tests/_ci/pear_setup.sh
- bash tests/_ci/install_prereqs_$PHP_MAJOR.sh
- if [ ! -z "${GH_TOKEN}" ]; then composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"; fi;
- if [ ! -f "$HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini" ]; then mkdir -p $HOME/cphalcon/$PHALCON_VERSION && git clone -q --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon/$PHALCON_VERSION >/dev/null 2>&1; fi;
install:
- travis_retry composer install --prefer-dist --no-interaction --quiet --no-ansi --no-progress --optimize-autoloader --dev --no-suggest --ignore-platform-reqs
# See https://github.com/aerospike/aerospike-client-php/issues/127
- '[[ "$PHP_MAJOR" == "5" ]] || bash ${TRAVIS_BUILD_DIR}/tests/_ci/install_aerospike.sh'
- if [ ! -f $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so ]; then cd $HOME/cphalcon/$PHALCON_VERSION/build && bash ./install --phpize $(phpenv which phpize) --php-config $(phpenv which php-config) && mkdir -p $HOME/ext/$PHP_VERSION/$PHALCON_VERSION && cp $PHP_EXTENSION_DIR/phalcon.so $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so; fi;
- if [ -f $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so ]; then cp $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so $PHP_EXTENSION_DIR/phalcon.so; fi;
- phpenv config-add $HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini
- phpenv config-add ${TRAVIS_BUILD_DIR}/tests/_ci/redis.ini
- cd $TRAVIS_BUILD_DIR
- $(phpenv which php) --ri phalcon
before_script:
# Create database and user
- echo 'CREATE DATABASE incubator CHARSET=utf8 COLLATE=utf8_unicode_ci' | mysql -u root
- echo "CREATE USER 'incubator'@'%' IDENTIFIED BY 'secret'" | mysql -u root
- echo "GRANT ALL PRIVILEGES ON incubator.* TO 'incubator'@'%' WITH GRANT OPTION" | mysql -u root
- cat ${TRAVIS_BUILD_DIR}/tests/_data/dump.sql | mysql -u root incubator
# See https://github.com/aerospike/aerospike-client-php/issues/127
- '[[ "${PHP_MAJOR:0:1}" == "5" ]] || bash ${TRAVIS_BUILD_DIR}/tests/_ci/install_aserver.sh'
script:
- vendor/bin/phpcs
- vendor/bin/codecept build
- vendor/bin/codecept run -v tests/unit
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/codecept run -v tests/aerospike'
- '[[ "$PHP_MAJOR" == "7" ]] || vendor/bin/codecept run -v tests/unit5x'
notifications:
email:
recipients:
on_success: change
on_failure: always
addons:
apt:
packages:
- re2c
- beanstalkd
- python-bcrypt
- build-essential
- autoconf
- libssl-dev
- libyaml-dev
- liblua5.1-dev
- mysql-server-5.6
- mysql-server-core-5.6
- mysql-client-5.6
hosts:
- db
- incubator.local