Skip to content

Coverage

Coverage #9

Workflow file for this run

name: Coverage
on:
workflow_run:
workflows: ["Unit Tests"]
types:
- completed
jobs:
test:
runs-on: ubuntu-latest
name: Check coverage
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
rm -f .coverage
rm -f coverage.xml
pytest --cov=./ --cov-report=xml
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_PR_RUN_ID: ${{ github.run_id }}
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v3
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt