.travis.yml
language: php
sudo: false
dist: trusty
os: linux
matrix:
include:
- php: 7.1
- php: 7.2
- php: 7.2
if: branch = master
env: coverage=true
fast_finish: true
cache:
directories:
- $HOME/.composer/cache/files
before_install:
- |
if ! [[ $coverage ]]; then
phpenv config-rm xdebug.ini
fi
- composer self-update
install:
- composer install
before_script:
- |
if [[ $coverage ]]; 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 [[ $coverage ]]; then
phpunit --coverage-clover clover.xml
else
phpunit
fi
after_success:
- |
if [[ $coverage ]]; then
./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT
fi