Skip to content

feat(workflows): test coverage report #9

feat(workflows): test coverage report

feat(workflows): test coverage report #9

Workflow file for this run

name: Run Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
name: Run Tests with coverage
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install '.[test]'
- name: Run tests with coverage
run: |
pytest --cov=frame_transforms --cov-report=xml --cov-report=term-missing tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
verbose: true
- name: Comment coverage on PR
if: github.event_name == 'pull_request'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MINIMUM_GREEN: 80
MINIMUM_ORANGE: 70