Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up automatic code-coverage report for backend #817

Closed
14 changes: 13 additions & 1 deletion .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:

- name: Build the stack
run: docker-compose up --build -d

- name: create coverage directory
run: docker exec mathesar_service mkdir coverage_report

- name: Run tests with pytest
run: docker exec mathesar_service pytest mathesar/ db/
run: docker exec mathesar_service pytest mathesar/ db/ --cov=mathesar --cov=db --cov-report=xml:coverage_report/coverage.xml

- name: Save the coverage report
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage_report
flags: pytest-backend
name: codecov-mathesar
verbose: true
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ ipython==7.21.0
pytest==6.2.3
pytest-django==4.2.0
pytest-env==0.6.2
pytest-cov==3.0.0
Sphinx==3.5.3