forked from GoogleChromeLabs/wp-native-lazyload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
70 lines (70 loc) · 1.39 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
sudo: false
dist: trusty
language: php
cache:
directories:
- vendor
- $HOME/.composer/cache
matrix:
include:
- php: 7.3
env: UNIT=1 PHPLINT=1 PHPCS=1 COVERAGE=1 JSLINT=1
- php: 7.0
env: UNIT=1 PHPLINT=1
dist: trusty
- php: nightly
env: UNIT=1
allow_failures:
- php: nightly
env: UNIT=1
before_install:
- |
if [[ "$COVERAGE" != "1" ]]; then
stable='^[0-9\.]+$'
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
phpenv config-rm xdebug.ini
fi
fi
- |
case "$TRAVIS_PHP_VERSION" in
5.6|5.5|5.4|5.3)
composer global require "phpunit/phpunit:^4"
composer install
PHPUNIT_BIN="phpunit"
;;
5.2)
PHPUNIT_BIN="phpunit"
;;
*)
composer install
PHPUNIT_BIN="vendor/bin/phpunit"
;;
esac
- npm install
- npm run build
before_script:
- phpenv rehash
script:
- |
if [[ "$PHPLINT" == "1" ]]; then
composer run-script phplint
fi
- |
if [[ "$PHPCS" == "1" ]]; then
composer run-script phpcs
fi
- |
if [[ "$JSLINT" == "1" ]]; then
npm run lint
fi
- |
if [[ "$UNIT" == "1" ]]; then
if [[ "$COVERAGE" == "1" ]]; then
mkdir -p tests/logs
$PHPUNIT_BIN --coverage-clover tests/logs/clover.xml
else
$PHPUNIT_BIN
fi
fi
notifications:
email: false