diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02a887d7f..67191a6ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/codacy_coverage_reporter.yml b/.github/workflows/codacy_coverage_reporter.yml new file mode 100644 index 000000000..5b677ab26 --- /dev/null +++ b/.github/workflows/codacy_coverage_reporter.yml @@ -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