-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.travis.yml
More file actions
67 lines (59 loc) · 2.54 KB
/
Copy path.travis.yml
File metadata and controls
67 lines (59 loc) · 2.54 KB
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
# Travis CI Configuration File
# Use Travis CI container-based infrastructure
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
# Tell Travis CI we're using PHP
language: php
# PHP version used in first build configuration.
# https://secure.php.net/supported-versions.php
# php:
# # PHP pre-5.6 is EOL
# - "5.6"
# # PHP 7.0 is EOL
# - "7.1"
# - "7.2"
# - "7.3"
# WordPress version used in first build configuration.
# env:
# - WP_VERSION=4.2.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# for a breakdown of why these versions were chosen, see https://github.com/INN/WP-DS-NPR-API/issues/12#issuecomment-374730094
matrix:
include:
# PHPUnit 5
- php: 5.6
env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# PHPUnit 6
- php: 7.1
env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
- php: 7.1
env: WP_VERSION=5.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
- php: 7.1
env: WP_VERSION=5.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# PHPUnit 8, based on https://github.com/INN/link-roundups/issues/135#issuecomment-470357566
#- php: 7.2
# env: WP_VERSION=5.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# PHPUnit 8, based on https://github.com/INN/link-roundups/issues/135#issuecomment-470357566
#- php: 7.3
# env: WP_VERSION=5.1 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# Only test the develop and master branches for now
branches:
only:
- develop
- master
# Clones WordPress and configures our testing environment.
before_script:
- export SLUG=$(basename $(pwd))
- svn co --quiet http://develop.svn.wordpress.org/tags/$WP_VERSION $WP_CORE_DIR
- cd ..
- mv $SLUG "$WP_CORE_DIR/src/wp-content/plugins/$SLUG"
- cd $WP_CORE_DIR
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/src/':" wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
- mv wp-tests-config.php "$WP_TESTS_DIR/wp-tests-config.php"
- cd "$WP_CORE_DIR/src/wp-content/plugins/$SLUG"
- phpunit --version
script: phpunit