TEST Move coverage build to the start of the matrix, and only post coverage on success

This commit is contained in:
Robbie Averill 2017-01-27 00:20:25 +13:00
parent 2bb61dcfcc
commit 8fa9207693

View File

@ -20,6 +20,9 @@ env:
matrix: matrix:
include: include:
- php: 7.1
env: DB=MYSQL CORE_RELEASE=4 COVERAGE=1
- php: 5.5 - php: 5.5
env: DB=MYSQL CORE_RELEASE=4 env: DB=MYSQL CORE_RELEASE=4
@ -33,10 +36,6 @@ matrix:
- php: 7.0 - php: 7.0
env: DB=MYSQL CORE_RELEASE=4 env: DB=MYSQL CORE_RELEASE=4
- php: 7.1
env: DB=MYSQL CORE_RELEASE=4 COVERAGE=1
before_script: before_script:
- phpenv rehash - phpenv rehash
- composer self-update || true - composer self-update || true
@ -53,8 +52,8 @@ script:
# Execute tests with coverage. Do this for a small # Execute tests with coverage. Do this for a small
- "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi" - "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi"
#Upload coverage even if there is a failure # Upload code coverage when tests pass
after_script: after_success:
- "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi" - "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi"
- cd ~/build/$TRAVIS_REPO_SLUG - cd ~/build/$TRAVIS_REPO_SLUG
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov; fi" - "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov; fi"