Files
concrete/script/actions_utils/coverage.sh
Arthur Meyre ef78e66241 build(coverage): add comment to PR with diff-cover output
- add script to help format the coverage comment
- manage steps logic

refs #15
2021-07-16 12:25:10 +02:00

20 lines
537 B
Bash

CURR_DIR=`dirname $0`
# Run diff-coverage
poetry run diff-cover coverage.xml --fail-under 100 \
--html-report coverage.html \
--compare-branch origin/"$1" | tee diff-coverage.txt
# Get exit code without closing the script
TEST_EXIT_CODE="$?"
# Format diff-coverage.txt for PR comment
poetry run python script/actions_utils/coverage_report_format.py \
--diff-cover-exit-code "$TEST_EXIT_CODE" \
--diff-cover-output diff-coverage.txt
# Set exit code if test failed
if [[ "$TEST_EXIT_CODE" != "0" ]]; then
exit "$TEST_EXIT_CODE"
fi