This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
/
.travis.yml
62 lines (55 loc) · 1.68 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
# Travis CI Configuration file
# @link https://travis-ci.org/
# Use new Travis container-based infrastructure
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
# PHP
# @link http://docs.travis-ci.com/user/languages/php/
language: php
# 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
# WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and
# x.y mirrors the latest from the x.y branch
env:
# WordPress 5.2
- WP_VERSION=5.2
# WordPress 5.1
- WP_VERSION=5.1
# WordPress 5.0
- WP_VERSION=5.0
# WordPress 4.9
- WP_VERSION=4.9
# WordPress 4.8
- WP_VERSION=4.8
# WordPress 4.7
- WP_VERSION=4.7
matrix:
fast_finish: true
# before_install: Failures in this section will result in build status 'errored'
before_install:
# 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