2014-09-07 18:53:33 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-10-05 16:09:39 +00:00
|
|
|
# usage: travis.sh before|after
|
2014-09-07 18:53:33 +00:00
|
|
|
|
|
|
|
if [ $1 == 'before' ]; then
|
|
|
|
|
2017-11-23 11:13:09 +00:00
|
|
|
# Remove Xdebug from PHP runtime for all PHP version except 7.1 to speed up builds.
|
|
|
|
# We need Xdebug enabled in the PHP 7.1 build job as it is used to generate code coverage.
|
|
|
|
if [[ ${RUN_CODE_COVERAGE} != 1 ]]; then
|
|
|
|
phpenv config-rm xdebug.ini
|
|
|
|
fi
|
|
|
|
|
2018-02-27 17:20:13 +00:00
|
|
|
composer global require "phpunit/phpunit=6.*"
|
|
|
|
|
|
|
|
if [[ ${RUN_PHPCS} == 1 ]]; then
|
|
|
|
composer install
|
|
|
|
fi
|
|
|
|
|
2014-09-07 18:53:33 +00:00
|
|
|
fi
|
2017-09-26 12:24:11 +00:00
|
|
|
|
2017-09-26 13:09:27 +00:00
|
|
|
if [ $1 == 'after' ]; then
|
|
|
|
|
2017-11-13 18:19:36 +00:00
|
|
|
if [[ ${RUN_CODE_COVERAGE} == 1 ]]; then
|
2017-09-26 13:09:27 +00:00
|
|
|
bash <(curl -s https://codecov.io/bash)
|
2017-09-26 14:21:05 +00:00
|
|
|
wget https://scrutinizer-ci.com/ocular.phar
|
2017-10-05 16:09:39 +00:00
|
|
|
chmod +x ocular.phar
|
2017-09-26 14:21:05 +00:00
|
|
|
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|
2017-09-26 12:24:11 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-07 14:31:37 +00:00
|
|
|
curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
|
|
|
|
artifacts upload
|
|
|
|
|
2017-09-26 12:24:11 +00:00
|
|
|
fi
|