Files
python-template/.github/workflows/pr_checks.yaml

49 lines
1.2 KiB
YAML

name: PR Checks
on:
pull_request:
branches:
- '*'
jobs:
comment_coverage:
name: Comment coverage on PR
runs-on: ubuntu-latest
steps:
- name: 🔀 checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
submodules: 'recursive'
- name: 📦 install uv
uses: astral-sh/setup-uv@v5
- name: 🐍 python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: 📦 sync depedencies
run: |
uv sync
uv sync --group test
- name: configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: 🧪 run coverage
run: |
uv run pytest --cov --junitxml=pytest.xml --cov-report=term-missing | tee pytest-coverage.txt
continue-on-error: true
- name: 📊 comment coverage
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: pytest-coverage.txt
junitxml-path: pytest.xml