-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
92 lines (82 loc) · 2.12 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
language: php
sudo: false
matrix:
include:
- php: 5.6
env: WP_VERSION=tags/5.3
- php: 7.0
env: WP_VERSION=tags/5.3
- php: 7.1
env: WP_VERSION=tags/5.3
- php: 7.2
env: WP_VERSION=tags/5.3
- php: 7.2
env: WP_VERSION=trunk
allow_failures:
- env: WP_VERSION=trunk
services:
- mysql
before_install:
- composer self-update
- composer install --no-interaction
# set up WP install
- export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR
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
- cd $WP_DEVELOP_DIR/..
- rm -rf wordpress
- mkdir wordpress
- svn co https://develop.svn.wordpress.org/$WP_VERSION $WP_DEVELOP_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
- cd $TRAVIS_BUILD_DIR
- |
# Install the specified version of PHPUnit depending on the PHP version:
case "$TRAVIS_PHP_VERSION" in
7.2|7.1|7.0)
echo "Using PHPUnit 6.x"
wget -O phpunit.phar https://phar.phpunit.de/phpunit-6.phar
;;
5.6|5.5|5.4|5.3)
echo "Using PHPUnit 4.x"
wget -O phpunit.phar https://phar.phpunit.de/phpunit-4.phar
;;
esac
- chmod +x ./phpunit.phar
- ./phpunit.phar --version
script:
- |
if [[ "$TRAVIS_PHP_VERSION" == "7.2" && "$WP_VERSION" == "5.3" ]] ; then
./phpunit.phar --coverage-clover=coverage.clover
else
./phpunit.phar
fi
after_success:
- bash <(curl -s https://codecov.io/bash)
git:
depth: 3
branches:
only:
- master
notifications:
slack:
rooms:
- ironbounddesigns:fXMBlqSr9vvDBiwetLNm9ctD#general
on_success: change
on_failure: always
on_start: never
email: false