diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 22ce281..1c4f315 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,5 +27,12 @@ jobs: - name: Run tests run: | cd $GITHUB_WORKSPACE - export PYTHONPATH=$PYTHONPATH:./backend - pytest backend/tests/ \ No newline at end of file + export PYTHONPATH=$GITHUB_WORKSPACE:$GITHUB_WORKSPACE/backend + pytest --cov=./backend --cov-report=xml:coverage.xml backend/tests/ + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + fail_ci_if_error: true diff --git a/backend/requirements.txt b/backend/requirements.txt index d969e6d..61bf6da 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -16,3 +16,4 @@ pytest-asyncio httpx mongomock-motor pytest-env +pytest-cov