-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.travis.yml
98 lines (81 loc) · 2.23 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
97
98
sudo: false
# Xenial does not start mysql by default
services:
- mysql
language: php
notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
- master-1.x
cache:
directories:
- $HOME/.composer/cache
- $HOME/.config/composer/cache
matrix:
include:
- php: 5.6
env: WP_VERSION=latest PHP_LINT=1 ES_VERSION=2.4.6
dist: trusty
- php: 7.3
env: WP_VERSION=latest WP_PHPCS=1 ES_VERSION=5.6.16
dist: xenial
- php: 7.3
env: WP_VERSION=latest PHP_LINT=1 ES_VERSION=6.8.8
dist: xenial
- php: 7.4
env: WP_VERSION=nightly PHP_LINT=1 ES_VERSION=7.6.2
dist: xenial
fast_finish: true
install:
- bash bin/install-es.sh $ES_VERSION
before_script:
- export PATH="$HOME/.config/composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH"
# Turn off Xdebug. See https://core.trac.wordpress.org/changeset/40138.
- phpenv config-rm xdebug.ini || echo "Xdebug not available"
# Couple the PHPUnit version to the PHP version.
- |
case "$TRAVIS_PHP_VERSION" in
5.6)
echo "Using PHPUnit 4.8"
composer global require "phpunit/phpunit=4.8.*"
;;
*)
echo "Using PHPUnit 6.1"
composer global require "phpunit/phpunit=6.1.*"
;;
esac
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
fi
- |
if [[ "$WP_PHPCS" == "1" ]]; then
composer global require automattic/vipwpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs
fi
# Wait up to 60 seconds until ES is up, or die if it never comes up.
- |
failures=0
curl localhost:9200;
while [[ $? -ne 0 && $failures -lt 60 ]]; do
sleep 1
((failures++))
curl localhost:9200
done
if [ $? -ne 0 ]; then
echo "Elasticsearch is unavailable."
cat /tmp/elasticsearch.log
exit 1
fi
- phpunit --version
script:
- if [[ "$PHP_LINT" == "1" ]]; then find . -type "f" -iname "*.php" | xargs -L "1" php -l; fi
- if [[ "$WP_PHPCS" == "1" ]]; then phpcs; fi
- phpunit
- phpunit -c multisite.xml
after_script:
- cat /tmp/elasticsearch.log