forked from argoproject/Argo
-
-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy path.travis.yml
96 lines (87 loc) · 3.3 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
# 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.
# We only support PHP-supported versions of PHP.
# https://secure.php.net/supported-versions.php
# php:
# - "5.6"
# - "7.0"
# - "7.1"
# - "7.2"
# - "7.3"
# WordPress version used in first build configuration.
# env:
# - WP_VERSION=master
# - WP_VERSION=4.9
# - WP_VERSION=4.8
# - WP_VERSION=4.7
# - WP_VERSION=4.6
#
# The GUTENBERG env var should be set in WordPress versions where we want to run Gutenberg tests, but Gutenberg has not yet been included in WordPress Core. For 5.0, there is no need to set the GUTENBERG variable.
#
# For a breakdown of why these versions were chosen, see https://github.com/INN/WP-DS-NPR-API/issues/12#issuecomment-374730094
# This list should be rechecked periodically.
matrix:
include:
# PHPunit 5
- php: 5.6
env: WP_VERSION=4.6
- php: 5.6
env: WP_VERSION=4.7
- php: 5.6
env: WP_VERSION=4.8
- php: 5.6
env: WP_VERSION=4.9
# - php: 5.6
# env: WP_VERSION=4.9 GUTENBERG=1
# PHPUnit 6
- php: 7.0
env: WP_VERSION=4.8
- php: 7.0
env: WP_VERSION=4.9
# - php: 7.0
# env: WP_VERSION=4.9 GUTENBERG=1
# PHPUnit 6
- php: 7.1
env: WP_VERSION=4.9
# - php: 7.1
# env: WP_VERSION=4.9 GUTENBERG=1
- php: 7.1
env: WP_VERSION=5.0
# PHPUnit 7 support will come with https://core.trac.wordpress.org/ticket/43218
# - php: 7.2
# env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# - php: 7.2
# env: WP_VERSION=5.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# - php: 7.3
# env: WP_VERSION=4.9 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# - php: 7.3
# env: WP_VERSION=5.0 WP_TESTS_DIR=/tmp/wordpress/tests/phpunit WP_CORE_DIR=/tmp/wordpress
# Only test the main development branches for now
branches:
only:
- 0.5
- 0.5-dev
# Clones WordPress and configures our testing environment.
before_script:
- export SLUG=$(basename $(pwd))
- export WP_TESTS_DIR=/tmp/wordpress/tests/phpunit
- export WP_CORE_DIR=/tmp/wordpress/
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_CORE_DIR
- if [ GUTENBERG ]; then git clone --depth=1 --branch="v4.6.0" https://github.com/WordPress/gutenberg.git $WP_CORE_DIR'src/wp-content/plugins/gutenberg'; fi
- cd ..
- mv $SLUG "$WP_CORE_DIR/src/wp-content/themes/$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/themes/$SLUG"
script: phpunit