Skip to content

Commit

Permalink
move after_script stuff to separate bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed May 22, 2018
1 parent dc3be56 commit 2f51c81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ cache:
- $HOME/.phpbrew

script: ./tests/bin/run-wp-unit-tests.sh
after_script: ./tests/bin/after-run-wp-unit-tests.sh

branches:
only:
Expand Down
12 changes: 12 additions & 0 deletions tests/bin/after-run-wp-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

cd "$(dirname "$0")/../../"

echo "Tests complete ($TRAVIS_TEST_RESULT). Sending code coverage reports."

wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover clover.xml

if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ ! -z "$CC_TEST_REPORTER_ID" ]] && [[ ! -z $(php -i | grep xdebug) ]]; then
./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT;
fi
7 changes: 0 additions & 7 deletions tests/bin/run-wp-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,3 @@ if [[ latest == $WP_VERSION ]]; then
else
phpunit --exclude-group cmb2-rest-api --coverage-clover=clover.xml || exit 1;
fi

wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover clover.xml

if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ ! -z "$CC_TEST_REPORTER_ID" ]] && [[ ! -z $(php -i | grep xdebug) ]]; then
./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT;
fi

0 comments on commit 2f51c81

Please sign in to comment.