-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
103 lines (96 loc) · 2.47 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
sudo: false
language: php
# Cache some data across builds for performance.
cache:
apt: true
directories:
- node_modules
# Set the default environment.
env:
global:
- WP_TRAVISCI=travis:phpunit
- WP_VERSION=latest
- WP_MULTISITE=1
notifications:
email:
on_success: never
on_failure: change
slack:
on_pull_requests: true
on_success: change
on_failure: always
on_start: never
on_cancel: always
rooms:
- wsu-ucomm:n2TLZRJd84rMOMbkKthSEMgS
branches:
only:
- master
matrix:
include:
- php: 5.6
- php: 7.0
- php: 7.0
env: WP_MULTISITE=0
- php: 7.0
env: WP_VERSION=nightly
- php: 7.0
env: WP_TRAVISCI=travis:grunt
before_script:
- |
# Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
stable='^[0-9\.]+$'
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
phpenv config-rm xdebug.ini
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 [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
case "$TRAVIS_PHP_VERSION" in
7.1|7.0|hhvm|nightly)
echo "Using PHPUnit 5.7"
composer global require "phpunit/phpunit=5.7.*"
;;
5.6|5.5|5.4|5.3)
echo "Using PHPUnit 4.8"
composer global require "phpunit/phpunit=4.8.*"
;;
*)
echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
exit 1
;;
esac
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
fi
- |
if [[ "$WP_TRAVISCI" == "travis:grunt" ]]; then
composer install
fi
- npm --version
- node --version
- nvm install stable
- npm install -g grunt-cli
- npm install
- npm prune
- mysql --version
- phpenv versions
- php --version
- npm --version
- node --version
script:
- |
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]] ; then
phpunit --version
phpunit
fi
- |
if [[ "$WP_TRAVISCI" == "travis:grunt" ]] ; then
grunt --version
grunt default
fi