From d01f879730e47f066891e6acfac25a3b65985d8e Mon Sep 17 00:00:00 2001 From: Justin Sternberg Date: Mon, 21 May 2018 14:09:03 -0400 Subject: [PATCH] Attempt to send coverage report to codeclimate --- .travis.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dbeae5838..bd50cc6f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,17 @@ dist: trusty matrix: include: - php: nightly - env: WP_VERSION=latest + env: + global: + - WP_VERSION=latest + - CC_TEST_REPORTER_ID=7200f3ac9aab067d6a3c75ddf45f1cadbfb0ee1f9ef902f4e2d005a2511c5745 + - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi) - php: 7.1 - env: WP_VERSION=latest + env: + global: + - WP_VERSION=latest + - CC_TEST_REPORTER_ID=7200f3ac9aab067d6a3c75ddf45f1cadbfb0ee1f9ef902f4e2d005a2511c5745 + - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi) - php: 5.6 env: WP_VERSION=latest - php: 5.6 @@ -56,6 +64,12 @@ script: if [[ latest == $WP_VERSION ]]; then phpunit --coverage-clover=coverage. after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + - | + if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + if [[ ! -z "$CC_TEST_REPORTER_ID" ]] ; then + ./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT; + fi + fi branches: only: