.travis.yml
sudo: false
language: php
cache:
directories:
- vendor
- $HOME/.composer/cache
matrix:
include:
- php: 7.2
env: PHPLINT=1 PHPCS=1 COVERAGE=1
- php: 7.1
- php: 7.0
allow_failures:
- php: nightly
before_script:
- composer self-update
- composer install
- |
if [[ "$COVERAGE" == "1" ]]; then
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
fi
script:
- |
if [[ "$PHPLINT" == "1" ]]; then
find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
fi
- |
if [[ "$PHPCS" == "1" ]]; then
vendor/bin/phpcs -v --runtime-set ignore_warnings_on_exit 1
fi
- |
if [[ -z "$CODECLIMATE_REPO_TOKEN" ]]; then
COVERAGE="0"
fi
- |
if [[ "$COVERAGE" == "1" ]]; then
mkdir -p build/logs
vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml
else
vendor/bin/phpunit -c phpunit.xml
fi
after_script:
- |
if [[ "$COVERAGE" == "1" ]]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
fi
notifications:
email: false