-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (40 loc) · 1.19 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
sudo: false
dist: trusty
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- language: php
php: 7.2
env: WP_TRAVISCI=phpcs
- language: php
php: 7.1
env: WP_TRAVISCI=phpcs
- language: php
php: 7.0
env: WP_TRAVISCI=phpcs
before_script:
- if [[ "$WP_TRAVISCI" == "phpcs" ]]; then export PATH="$HOME/.composer/vendor/bin:$PATH"; fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
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 [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
composer global require wimg/php-compatibility
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/wimg/php-compatibility
fi
script:
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
phpcs -p -s -v . --standard=./phpcs.xml --extensions=php --runtime-set testVersion $TRAVIS_PHP_VERSION
fi
notifications:
email: false