-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
67 lines (54 loc) · 1.42 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
sudo: false
dist: trusty
language: php
notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- php: 7.4
env: WP_VERSION=latest
- php: 7.3
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk
- php: 5.6
env: WP_VERSION=4.9
- php: 7.4
env: WP_TRAVISCI=phpcs
before_install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# Unless we need XDebug, disable it for improved performance.
- phpenv config-rm xdebug.ini || return 0
install:
# Install our Composer dependencies
- composer update
# Install an older version of PHPUnit if we're still running PHP 5.6.
- |
if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then
wget -O ./vendor/bin/phpunit https://phar.phpunit.de/phpunit-5.phar
chmod +x ./vendor/bin/phpunit
fi
# Install the WordPress core test suite
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
script:
- |
# If we've set the $WP_TRAVISCI variable to run PHPCS, do that instead
# of running PHPUnit.
if [[ "$WP_TRAVISCI" == "phpcs" ]]; then
npm run lint
else
# Execute the test suite
./vendor/bin/phpunit
# Optionally run the tests again in a multisite environment
#WP_MULTISITE=1 ./vendor/bin/phpunit
fi