forked from yiisoft/yii-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (85 loc) · 2.38 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
#
# Travis Setup
#
# build only on master branches
# commented as this prevents people from running builds on their forks:
# https://github.com/yiisoft/yii2/commit/bd87be990fa238c6d5e326d0a171f38d02dc253a
#branches:
# only:
# - master
# - 3.0
#
# Test Matrix
#
language: php
env:
global:
- DEFAULT_COMPOSER_FLAGS="--prefer-dist --no-interaction --no-progress --optimize-autoloader"
- TRAVIS_SECOND_USER=travis_two
services:
- memcached
- mysql
- postgresql
# cache vendor dirs
cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.npm
# try running against postgres 9.6
addons:
postgresql: "9.6"
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
code_climate:
repo_token: 2935307212620b0e2228ab67eadd92c9f5501ddb60549d0d86007a354d56915b
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.3
- php: nightly
services:
- mysql
- postgresql
allow_failures:
- php: nightly
before_install:
# Always remove xdebug.
- phpenv config-rm xdebug.ini || echo "xdebug is not installed"
install:
# install composer dependencies
- travis_retry composer self-update
# Fast composer install
- travis_retry composer global require hirak/prestissimo
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS
# setup PHP extension
- |
if [[ $TRAVIS_PHP_VERSION != nightly ]]; then
tests/data/travis/apcu-setup.sh
tests/data/travis/memcache-setup.sh
tests/data/travis/imagick-setup.sh
fi
before_script:
# show some versions and env information
- php --version
- composer --version
- php -r "echo INTL_ICU_VERSION . \"\n\";"
- php -r "echo INTL_ICU_DATA_VERSION . \"\n\";"
- psql --version
- mysql --version
# initialize databases
- mysql_upgrade
- travis_retry mysql -e 'CREATE DATABASE `yiitest`;';
- mysql -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';";
- psql -U postgres -c 'CREATE DATABASE yiitest;';
script:
# PHP tests
- phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group wincache,xcache
after_script:
- travis_retry wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover