2014-09-07 18:53:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# usage: travis.sh before|after
|
|
|
|
|
|
|
|
if [ $1 == 'before' ]; then
|
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# Composer install fails in PHP 5.2
|
2014-09-07 18:53:33 +00:00
|
|
|
[ $TRAVIS_PHP_VERSION == '5.2' ] && exit;
|
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# No Xdebug and therefore no coverage in PHP 5.3
|
|
|
|
[ $TRAVIS_PHP_VERSION == '5.3' ] && exit;
|
|
|
|
|
2016-03-23 10:46:35 +00:00
|
|
|
composer self-update
|
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# Install php-coveralls to send coverage info
|
2015-12-15 18:41:07 +00:00
|
|
|
composer init --require=satooshi/php-coveralls:0.7.0 -n
|
2014-09-07 18:53:33 +00:00
|
|
|
composer install --no-interaction
|
|
|
|
|
|
|
|
elif [ $1 == 'after' ]; then
|
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# No Xdebug and therefore no coverage in PHP 5.2 or 5.3
|
2014-09-07 18:53:33 +00:00
|
|
|
[ $TRAVIS_PHP_VERSION == '5.2' ] && exit;
|
2016-08-30 13:50:33 +00:00
|
|
|
[ $TRAVIS_PHP_VERSION == '5.3' ] && exit;
|
2014-09-07 18:53:33 +00:00
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# Send coverage data to coveralls
|
2014-09-07 18:53:33 +00:00
|
|
|
php vendor/bin/coveralls --verbose --exclude-no-stmt
|
2015-08-19 14:49:05 +00:00
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# Get scrutinizer ocular and run it
|
2015-08-19 14:49:05 +00:00
|
|
|
wget https://scrutinizer-ci.com/ocular.phar
|
2016-08-30 12:37:39 +00:00
|
|
|
chmod +x ocular.phar
|
|
|
|
php ocular.phar code-coverage:upload --format=php-clover ./tmp/clover.xml
|
2015-08-19 07:47:50 +00:00
|
|
|
|
2014-09-07 18:53:33 +00:00
|
|
|
fi
|