/
.travis.yml
executable file
·95 lines (83 loc) · 2.67 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
# Ditch sudo and use containers.
# @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F
# @link http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
language: php
services:
- mysql
notifications:
email:
on_success: never
on_failure: change
slack:
secure: QZrl08SxRfVNKKDwFxHzp8Yl+EQwabeNyF/mS/6HTfalV4tqaPXD9Xc8FY60c6Adgy3yrp1Vhv5h/XPL+Q2sROTDFE9oWWJcPHzQOr9qfRafrA4j2yyqVvhjZfjXtdqJgnS8Ubk3840kPAIrOyNCYbwHtTpcoNLoeVewM7mSQWI=
cache:
directories:
- vendor
- $HOME/.composer/cache
php:
- 5.6
- 7.2
- 7.3
- 7.4
env:
- WP_VERSION=latest WP_MULTISITE=0
matrix:
include:
# For PHP 5.6 also run Multisite
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=1
install:
- |
if [[ $TRAVIS_PHP_VERSION == 5.6 ]]; then
# The dev dependencies are not compatible with PHP 5.x or PHP 7.0
# So install phpunit globally and run composer without requiring dev dependencies.
composer global require "phpunit/phpunit=4.8.*|5.7.*"
composer install --no-dev
else
composer install
fi
before_script:
- rm -rf /tmp/wordpress-tests-lib
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
- |
if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then
# Disable x-debug to increase performance. x-debug is enabled only for PHP 7.3 to run code-coverage reports.
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
fi
- |
if [[ $TRAVIS_PHP_VERSION == 7.2 ]]; then
# In PHP 7.2 run uninstall tests.
export WP_TESTS_DIR=/tmp/wordpress-tests-lib/
ln -s `pwd` /tmp/wordpress/wp-content/plugins/email-log
fi
script:
- |
if [[ $TRAVIS_PHP_VERSION == 5.6 ]]; then
# phpunit is installed globally for PHP 5.6
phpunit
else
if [[ $TRAVIS_PHP_VERSION == 7.3 ]]; then
# Run code coverage for PHP 7.3 alone
vendor/bin/phpunit --coverage-clover=coverage.clover
else
vendor/bin/phpunit
if [[ $TRAVIS_PHP_VERSION == 7.2 ]]; then
# Run uninstall tests in PHP 7.2
vendor/bin/phpunit --group=uninstall-delete
vendor/bin/phpunit --group=uninstall
# Run PHPCompatibility code sniffs.
bash bin/phpcs.sh
fi
fi
fi
after_script:
- |
if [[ $TRAVIS_PHP_VERSION == 7.3 ]]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi