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

Coverage reports for Codacy #701

Merged
merged 10 commits into from
May 19, 2023
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,16 @@ jobs:
poetry run git lfs fetch
poetry run git lfs pull
# poetry run pytest
poetry run python -m unittest discover -s tests/ -t . -vv
poetry run coverage run -m unittest discover -s tests/ -t . -vv

- name: Generate coverage report
if: runner.os == 'Linux'
run: poetry run coverage xml

- name: Archive coverage report
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.xml
retention-days: 30
24 changes: 24 additions & 0 deletions .github/workflows/codacy_coverage_reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Codacy Coverage Reporter

on:
workflow_run:
workflows: ["Run CI"]
types:
- completed
workflow_dispatch:

jobs:
codacy-coverage-reporter:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
steps:
- uses: actions/download-artifact@v3
with:
name: coverage

- uses: actions/checkout@v3
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml