mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-11 14:07:48 -06:00
Add pytest/coverage file check since pytest-coverage-comment does not error
This commit is contained in:
7
.github/workflows/test.yaml
vendored
7
.github/workflows/test.yaml
vendored
@@ -55,9 +55,16 @@ jobs:
|
|||||||
cd backend
|
cd backend
|
||||||
set -o pipefail # otherwise 'tee' will eat the exit code
|
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
|
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
|
- name: Pytest coverage comment
|
||||||
id: coverageComment
|
id: coverageComment
|
||||||
|
if: steps.check-coverage-files.outputs.success == 'true'
|
||||||
uses: MishaKav/pytest-coverage-comment@main
|
uses: MishaKav/pytest-coverage-comment@main
|
||||||
with:
|
with:
|
||||||
pytest-coverage-path: backend/pytest-coverage.txt
|
pytest-coverage-path: backend/pytest-coverage.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user