upload to codecov if token is defined in environment

This commit is contained in:
Hans Dembinski 2019-06-08 21:16:54 +02:00
parent d075d1b86f
commit 83a271fa38
2 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

@ -8,4 +8,5 @@ __pycache__
.vs*
*.info
tools/lcov-*
tools/codecov
coverage-report

View File

@ -24,9 +24,11 @@ $LCOV --base-directory `pwd` \
# remove uninteresting entries
$LCOV --extract coverage.info "*/boost/histogram/*" --output-file coverage.info
if [ $CI ]; then
if [ -n $CI ] || [ -n $CODECOV_TOKEN ]; then
# upload if on CI
curl -s https://codecov.io/bash | bash -s - -f coverage.info -X gcov -x $GCOV
curl -s https://codecov.io/bash > tools/codecov
chmod u+x tools/codecov
tools/codecov -f coverage.info -X gcov
else
# otherwise generate html report
$LCOV_DIR/bin/genhtml coverage.info -o coverage-report