forked from lansuite/lansuite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
35 lines (29 loc) · 899 Bytes
/
.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
language: php
php:
- '7.2'
- '7.3'
- '7.4'
- nightly
matrix:
allow_failures:
- php: nightly
cache:
directories:
- $HOME/.composer/cache
install:
- phpenv rehash
- composer install --dev
before_script:
- bin/phpcs --version
- echo $TRAVIS_COMMIT
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_PULL_REQUEST_SHA
- echo $TRAVIS_EVENT_TYPE
script:
- CHANGED_FILES=`git diff --name-only --diff-filter=ACM $TRAVIS_COMMIT~ $TRAVIS_COMMIT`
- echo "$CHANGED_FILES"
- CHANGED_PHP_FILES=`echo "$CHANGED_FILES" | grep "\.php$"`
- if [ -z "$CHANGED_PHP_FILES" ]; then travis_terminate 0; fi;
- echo "$CHANGED_PHP_FILES" | xargs -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- echo "$CHANGED_PHP_FILES" | xargs -n1 -P4 bin/phpcs --standard=PSR1,PSR2 --exclude=Generic.Files.LineLength,PSR1.Methods.CamelCapsMethodName --extensions=php -s
- bin/phpunit