mirror of
https://github.com/pufereq/python-template.git
synced 2025-12-16 08:09:31 +00:00
ci: rework workflows for uv
This commit is contained in:
48
.github/workflows/pr_checks.yaml
vendored
Normal file
48
.github/workflows/pr_checks.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
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
|
||||
Reference in New Issue
Block a user