Skip to content

ci: add pytest workflow with optional codecov upload #4

ci: add pytest workflow with optional codecov upload

ci: add pytest workflow with optional codecov upload #4

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
- name: Install dependencies
run: uv sync --locked
- name: Run tests
run: uv run pytest --cov=persica --cov-report=xml
- name: Upload coverage
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v6
with:
token: ${{ env.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true