forked from bbpress/bbPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
115 lines (104 loc) · 3.02 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
# Travis CI Configuration File
# Tell Travis CI we're using PHP
language: php
# Tell Travis CI which operating system to use
os: linux
# Ensure MySQL is available
services:
- mysql
# Configure caches
cache:
directories:
- vendor
- $HOME/.composer/cache
- node_modules
# PHP version used in first build configuration.
php:
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 5.6
# WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and
# x.y mirrors the latest from the x.y branch
env:
- WP_VERSION=master
- WP_VERSION=5.3
- WP_VERSION=5.2
# Build matrix options
jobs:
include:
- php: nightly
env: WP_VERSION=master
exclude:
- php: 7.4
env: WP_VERSION=5.2
allow_failures:
- php: nightly
# fast_finish: true
# before_install: Failures in this section will result in build status 'errored'
before_install:
# setup WP_DEVELOP_DIR (needed for bbPress to bootstrap WP PHPUnit tests)
- export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR
# clone the WordPress develop repo
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
# clone the BuddyPress develop repo
- git clone --depth=1 git://buddypress.git.wordpress.org/ $WP_DEVELOP_DIR/src/wp-content/plugins/buddypress
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
- cd ..
- mv $plugin_slug $plugin_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
# setup NodeJS version using NVM
- node --version
- nvm install 12
- node --version
- npm install -g grunt-cli
- npm --version
- phpenv versions
- echo $TRAVIS_PHP_VERSION
- mysql --version
- php --version
- php -m
- phpunit --version
- curl --version
- grunt --version
- git --version
- svn --version
# before_script: Failures in this section will result in build status 'failed'
before_script:
- |
# 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:2} == "7." ]]; then
echo "Using latest PHPUnit 6.x branch"
composer global require "phpunit/phpunit=^6"
elif [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then
echo "Using latest PHPUnit 4.x branch"
composer global require "phpunit/phpunit=^4"
fi
- npm install
- grunt build
# Run tests
script:
- grunt travis
notifications:
email: false