diff --git a/.ci/publish_coverage.sh b/.ci/publish_coverage.sh index 3936f91900..d86b9d5fed 100755 --- a/.ci/publish_coverage.sh +++ b/.ci/publish_coverage.sh @@ -43,7 +43,7 @@ ARGS="" for file in `ls $ARTIFACT_FOLDER | grep ".info"`; do - ARGS="-a ${ARTIFACT_FOLDER}/${file}" + ARGS="${ARGS} -a ${ARTIFACT_FOLDER}/${file}" done @@ -54,3 +54,6 @@ genhtml -o /tmp/coverage_html /tmp/coverage.info | tee /tmp/coverage.log COVERAGE_PCT=`cat /tmp/coverage.log | tail -n 1 | awk '{print $2}'` echo "Coverage: $COVERAGE_PCT" + +pip install pybadges +python -m pybadges --left-text="test coverage" --right-text="${COVERAGE_PCT}" --right-color='#0c0' > /tmp/coverage_html/badge.svg diff --git a/.ci/test.sh b/.ci/test.sh index 1b7b7a865a..7fc70ff5f3 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -78,5 +78,5 @@ echo "$0: tests finished" echo "$0: storing coverage data" lcov --capture --directory ${WORKSPACE} --output-file /tmp/coverage.original -lcov --remove /tmp/coverage.original "*/test/" --output-file /tmp/coverage.removed || echo "$0: coverage tracefile is empty" +lcov --remove /tmp/coverage.original "*/test/*" --output-file /tmp/coverage.removed || echo "$0: coverage tracefile is empty" lcov --extract /tmp/coverage.removed "*/workspace/*" --output-file $ARTIFACT_FOLDER/$REPOSITORY_NAME.info || echo "$0: coverage tracefile is empty"