-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (64 loc) · 1.63 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
sudo: false
language: php
notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
cache:
- composer
- $HOME/.composer/cache
# Declare versions of PHP to test
php:
# aliased to a recent 7.1.x version
- 7.1
# aliased to a recent 7.0.x version
- 7.0
# aliased to a recent 5.6.x version
- 5.6
# aliased to a recent 5.5.x version
- 5.5
# aliased to a recent 5.4.x version
- 5.4
# WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and
# x.y mirrors the latest from the x.y branch
env:
# WordPress 4.7
- WP_VERSION=4.7
# WordPress 4.6
- WP_VERSION=4.6
# WordPress 4.5
- WP_VERSION=4.5
# WordPress 4.4
- WP_VERSION=4.4
# WordPress 4.3
- WP_VERSION=4.3
# WordPress 4.2
- WP_VERSION=4.2
# WordPress 4.1
- WP_VERSION=4.1
matrix:
fast_finish: true
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 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/travis/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# create database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# prepare for running the tests
- cd $plugin_dir
script: phpunit