Add pytest/coverage file check since pytest-coverage-comment does not error

This commit is contained in:
2024-11-09 15:28:11 -06:00
parent 78a82311a2
commit f1be6676d1

View File

@@ -55,9 +55,16 @@ jobs:
cd backend
set -o pipefail # otherwise 'tee' will eat the exit code
poetry run pytest --color=yes --cov=linkpulse --cov-report=term-missing:skip-covered --junitxml=pytest.xml | tee pytest-coverage.txt
# pytest-coverage-comment won't error if the files are missing
if [ ! -f backend/pytest-coverage.txt ] || [ ! -f backend/pytest.xml ]; then
echo "::error::Coverage files not found"
exit 1
fi
- name: Pytest coverage comment
id: coverageComment
if: steps.check-coverage-files.outputs.success == 'true'
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: backend/pytest-coverage.txt