forked from tsingsun/yii2-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (74 loc) · 2.01 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
#
# Travis Setup
#
# faster builds on new travis setup not using sudo
sudo: false
# 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
# - 2.1
#
# Test Matrix
#
language: php
env:
global:
- DEFAULT_COMPOSER_FLAGS="--prefer-dist --no-interaction --no-progress --optimize-autoloader"
- TASK_TESTS_PHP=1
- TASK_TESTS_JS=0
- TASK_TESTS_COVERAGE=0
# cache vendor dirs
cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.npm
matrix:
fast_finish: true
include:
# run tests coverage on PHP 7.1
- php: 7.1
env: TASK_TESTS_COVERAGE=1
- php: 7.0
allow_failures:
- php: 7.1
install:
- |
if [[ $TASK_TESTS_COVERAGE != 1 && $TRAVIS_PHP_VERSION != hhv* ]]; then
# disable xdebug for performance reasons when code coverage is not needed. note: xdebug on hhvm is disabled by default
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
fi
# install composer dependencies
- travis_retry composer self-update
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer global require "fxp/composer-asset-plugin:^1.3.1"
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS
before_script:
# show some versions and env information
- php --version
- composer --version
- |
if [ $TASK_TESTS_JS == 1 ]; then
node --version
npm --version
fi
# enable code coverage
- |
if [ $TASK_TESTS_COVERAGE == 1 ]; then
PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
fi
script:
# PHP tests
- |
if [ $TASK_TESTS_PHP == 1 ]; then
vendor/bin/phpunit --verbose $PHPUNIT_FLAGS --configuration phpunit.xml.dist
fi
after_script:
- |
if [ $TASK_TESTS_COVERAGE == 1 ]; then
travis_retry wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi