forked from wpengine/phpcompat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
85 lines (84 loc) · 1.77 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
sudo: false
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
env:
- WP_VERSION=latest
- WP_VERSION=4.5
dist: trusty
matrix:
include:
- php: 5.2
env: WP_VERSION=latest
dist: precise
- php: 5.2
env: WP_VERSION=4.5
dist: precise
- php: 5.3
env: WP_VERSION=latest
dist: precise
- php: 5.3
env: WP_VERSION=4.5
dist: precise
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=1
- php: 5.6
env: WP_VERSION=4.5 WP_MULTISITE=1
- php: 7.0
env: NPM_TESTS=1
before_script:
- |
stable='^[0-9\.]+$'
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
fi
fi
- |
if [[ "$NPM_TESTS" == "1" ]]; then
rm -rf ~/.nvm
git clone https://github.com/creationix/nvm.git ~/.nvm
cd ~/.nvm
git checkout `git describe --abbrev=0 --tags`
cd $TRAVIS_BUILD_DIR
source ~/.nvm/nvm.sh
nvm install 8
npm install
fi
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
case "$TRAVIS_PHP_VERSION" in
5.6|5.5|5.4|5.3)
composer global require "phpunit/phpunit:^4"
;;
5.2)
;;
*)
composer global require "phpunit/phpunit:^6"
;;
esac
- |
if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then
phpenv global 5.4
composer install
phpenv global "$TRAVIS_PHP_VERSION"
else
composer install
fi
- |
if [[ "$NPM_TESTS" != "1" ]]; then
tests/install-wp-tests.sh wordpress_tests travis "" localhost $WP_VERSION false
phpenv rehash
fi
script:
- |
if [[ "$NPM_TESTS" == "1" ]]; then
npm test
else
phpunit
fi