mirror of
https://github.com/pufereq/python-template.git
synced 2025-12-15 07:39:32 +00:00
49 lines
1.2 KiB
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
|