-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy path.travis.yml
62 lines (48 loc) · 1.58 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
cache:
apt: true
directories:
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
language: php
services:
- mysql
# Declare versions of PHP to use.
php:
- 5.6
- 7.0
- 7.1
- 7.2
- "7.4snapshot"
env:
global:
- WP_VERSION=master # Git equivalent of SVN /trunk
matrix:
include:
- php: 7.3
env: PHPCS=1
allow_failures:
- php: "7.4snapshot"
fast_finish: true
# Before install, failures in this section will result in build status 'errored'
before_install:
# Speed up build time by disabling Xdebug when its not needed.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# clone the WordPress develop repo
- WP_DEVELOP_DIR=/tmp/wordpress
- git clone --depth=1 --branch="master" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
# Install the dependencies.
- composer install
before_script:
- bash bin/install-wp-tests.sh wordpress_test root '' localhost master
script:
# Run the unit tests.
- vendor/bin/phpunit
# Lint the PHP files against parse errors.
- find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- if [[ $TRAVIS_PHP_VERSION == "5.6" || $TRAVIS_PHP_VERSION == "7.3" ]]; then composer validate --no-check-all; fi
# Check for code style violations, best practices and PHP cross-version compatibility.
- if [[ "$PHPCS" == "1" ]]; then vendor/bin/phpcs --report=full,summary; fi