-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
134 lines (125 loc) · 4.54 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
sudo: false
language: php
# Tell Travis CI which distro to use
dist: trusty
# Configure caches
cache:
directories:
- vendor
- $HOME/.composer/cache
php:
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
# Specify versions of WordPress to test against
# WP_VERSION = WordPress version number (use "master" for SVN trunk)
# BP_VERSION = Branch version of BuddyPress to test (use "master" for trunk
# or version number to one decimal point - eg. 2.9)
env:
- WP_VERSION=master BP_VERSION=master
- WP_VERSION=4.8 BP_VERSION=2.9
- WP_VERSION=4.7 BP_VERSION=2.9
- WP_VERSION=4.6 BP_VERSION=2.9
- WP_VERSION=4.5 BP_VERSION=2.9
- WP_VERSION=4.4 BP_VERSION=2.9
matrix:
include:
- php: 7.2
env: WP_VERSION=master BP_VERSION=master
- php: nightly
env: WP_VERSION=master BP_VERSION=master
- php: 5.3
env: WP_VERSION=master BP_VERSION=master
dist: precise
- php: 5.3
env: WP_VERSION=4.8 BP_VERSION=2.9
dist: precise
- php: 5.3
env: WP_VERSION=4.7 BP_VERSION=2.9
dist: precise
- php: 5.3
env: WP_VERSION=4.6 BP_VERSION=2.9
dist: precise
- php: 5.3
env: WP_VERSION=4.5 BP_VERSION=2.9
dist: precise
- php: 5.3
env: WP_VERSION=4.4 BP_VERSION=2.9
dist: precise
exclude:
- php: 7.1
env: WP_VERSION=4.6 BP_VERSION=2.9
- php: 7.1
env: WP_VERSION=4.5 BP_VERSION=2.9
- php: 7.1
env: WP_VERSION=4.4 BP_VERSION=2.9
allow_failures:
- php: 7.2
- php: nightly
before_install:
- |
# Remove Xdebug for a huge performance increase:
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]]; then composer global require --dev phpunit/phpunit ^4; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.4" ]]; then composer global require --dev phpunit/phpunit ^4; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then composer global require --dev phpunit/phpunit ^4; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then composer global require --dev phpunit/phpunit ^5; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "4.4" ]]; then composer global require --dev phpunit/phpunit ^5; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "4.5" ]]; then composer global require --dev phpunit/phpunit ^5; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "4.6" ]]; then composer global require --dev phpunit/phpunit ^5; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "4.7" ]]; then composer global require --dev phpunit/phpunit ^6; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "4.8" ]]; then composer global require --dev phpunit/phpunit ^6; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" && $WP_VERSION == "master" ]]; then composer global require --dev phpunit/phpunit ^6; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then composer global require --dev phpunit/phpunit ^6; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then composer global require --dev phpunit/phpunit ^6; fi
# setup NodeJS version using NVM
- node --version
- nvm install 6
- node --version
- npm install -g grunt-cli
- npm --version
- mysql --version
- phpenv versions
- php --version
- php -m
- phpunit --version
- curl --version
- grunt --version
- git --version
- svn --version
before_script:
# set up WP install
- export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
- cd ..
- mv $plugin_slug $plugin_dir
# set up BuddyPress
- buddypress_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/buddypress
- mkdir -p $buddypress_dir
- git clone --depth=1 --branch="$BP_VERSION" git://buddypress.git.wordpress.org/ $buddypress_dir
# set up tests config
- cd $WP_DEVELOP_DIR
- echo $WP_DEVELOP_DIR
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# prepare for running the tests
- cd $plugin_dir
- pwd
# run npm to install dependencies
- npm install
# run tests
script: grunt travis:phpunit