-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
72 lines (60 loc) · 2.02 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
# Run in Container-based environment - see https://docs.travis-ci.com/user/reference/overview/#Virtualization-environments
dist: trusty
sudo: false
language: php
notifications:
email:
on_success: never
on_failure: change
php:
- 7.1
- 7.2
- nightly
before_install:
# Turn off Xdebug
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
install: composer install --no-interaction
stages:
- lint and code standards
- test
jobs:
include:
- stage: lint and code standards
# Run PHP CodeSniffer and XMLLint against just PHP 7.1 job, even
# though the PHPCompatibility config checks against 7.0.
php: 7.1
addons:
apt:
packages:
- libxml2-utils # Needed for XML linting.
before_script:
- export XMLLINT_INDENT=" "
script:
# Validate the XML files.
# @link http://xmlsoft.org/xmllint.html
- xmllint --noout ./.phpcs.xml.dist
- xmllint --noout --schema ./vendor/phpunit/phpunit/phpunit.xsd ./phpunit.xml.dist
# Lint the PHP files against parse errors.
- if find . -path ./vendor -prune -o -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi
# Check code standards
- composer phpcs
- stage: test
# env: WP_VERSION=latest WP_MULTISITE=1
# install:
# - composer install --no-interaction
# - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
script:
- vendor/bin/phpunit --testsuite unit
- vendor/bin/infection
# - vendor/bin/phpunit --testsuite integration
fast_finish: true
allow_failures:
# Allow failures for unstable builds.
- php: nightly
cache:
apt: true
directories:
- $HOME/.composer/cache