-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
136 lines (125 loc) · 3.58 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
134
135
136
# Travis CI Configuration File
# Use new Travis container-based infrastructure
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
dist: trusty
# Tell Travis CI we're using PHP
language: php
# Configure caches
cache:
apt: true
directories:
- node_modules
- vendor
- $HOME/.composer/cache
php:
- 7.2
- 7.1
- 7.0
- 5.6
env:
global:
- BPBU_TRAVISCI=travis:phpunit
matrix:
- WP_VERSION=trunk BP_VERSION=master
- WP_VERSION=4.9 BP_VERSION=3.0
- WP_VERSION=4.9 BP_VERSION=2.5
- WP_VERSION=4.8 BP_VERSION=3.0
- WP_VERSION=4.8 BP_VERSION=2.5
- WP_VERSION=4.7 BP_VERSION=3.0
- WP_VERSION=4.7 BP_VERSION=2.5
matrix:
fast_finish: true
include:
- php: 5.3
env: WP_VERSION=trunk BP_VERSION=master
dist: precise
- php: 5.3
env: WP_VERSION=4.9 BP_VERSION=3.0
dist: precise
- php: 5.3
env: WP_VERSION=4.9 BP_VERSION=2.5
dist: precise
- php: 5.3
env: WP_VERSION=4.7 BP_VERSION=3.0
dist: precise
- php: 5.3
env: WP_VERSION=4.7 BP_VERSION=2.5
dist: precise
- php: 7.1
env: WP_VERSION=trunk BP_VERSION=master BPBU_TRAVISCI=travis:codecoverage
- php: nightly
env: WP_VERSION=trunk BP_VERSION=master
exclude:
- php: 7.2
env: WP_VERSION=4.8 BP_VERSION=3.0
- php: 7.2
env: WP_VERSION=4.8 BP_VERSION=2.5
- php: 7.2
env: WP_VERSION=4.7 BP_VERSION=3.0
- php: 7.2
env: WP_VERSION=4.7 BP_VERSION=2.5
allow_failures:
- php: nightly
- php: 7.3.0RC1
- env: WP_VERSION=trunk BP_VERSION=master BPBU_TRAVISCI=travis:codecoverage
before_install:
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 'false' $BP_VERSION
- npm --version
- node --version
- nvm install 8
- node --version
- npm --version
- npm install -g grunt-cli
- phpenv versions
- mysql --version
- php --version
- php -m
- which phpunit
- phpunit --version
- curl --version
- grunt --version
- git --version
- svn --version
# Clones WordPress and configures our testing environment.
before_script:
- |
# Remove Xdebug for a huge performance increase, but not from nightly:
if [[ "$BPBU_TRAVISCI" != "travis:codecoverage" && -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]]; then
phpenv config-rm xdebug.ini
else
echo "We are running codecoverage or xdebug.ini does not exist"
fi
- |
# Export Composer's global bin dir to PATH, but not on PHP 5.2:
if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
composer config --list --global
export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
fi
- |
# Install the specified version of PHPUnit depending on the PHP version:
if [[ "$BPBU_TRAVISCI" == "travis:phpunit" ]]; then
case "$TRAVIS_PHP_VERSION" in
7.3.0RC1|7.2|7.1|7.0|nightly)
echo "Using PHPUnit 6.x"
travis_retry composer global require "phpunit/phpunit:^6"
;;
5.6|5.5|5.4|5.3)
echo "Using PHPUnit 4.x"
travis_retry composer global require "phpunit/phpunit:^4"
;;
*)
echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
exit 1
;;
esac
fi
- npm install
- npm prune
script: grunt "$BPBU_TRAVISCI"
after_script:
- |
if [[ "$BPBU_TRAVISCI" == "travis:codecoverage" ]] ; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi