From b03fc53787f0b8f4f2e63c29e4f52d4edffd9b88 Mon Sep 17 00:00:00 2001 From: brantje Date: Tue, 3 Jan 2017 22:03:28 +0100 Subject: [PATCH] Add coverage to codacy --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa970fcf..7d45ac23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,8 @@ before_script: - cd apps/$APP_NAME/ - mkdir -p build - curl -sSL https://phar.phpunit.de/phpunit.phar -o build/phpunit.phar + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then composer require codacy/coverage; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - sh -c "if [ '$JSTESTS' = '1' ]; then npm install; fi" # - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass='' @@ -60,12 +62,14 @@ script: - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi" - cd apps/$APP_NAME/ - - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -v -c phpunit.xml --coverage-clover=coverage.clover; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -v -c phpunit.xml --coverage-clover=coverage.clover --coverage-php=phpunit; fi" + # Create coverage report - - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php vendor/bin/codacycoverage -v clover coverage.clover; fi" - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --access-token="$SCRUTINIZER_TOKEN" --format=php-clover coverage.clover; fi" - #- cd ../ + + - sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi" - sh -c "if [ '$JSTESTS' = '1' ]; then grunt karma; fi"