- Add pytest-cov to CI dependencies - Generate coverage report (xml + terminal) - Set minimum coverage threshold to 60% (current: 63%, target: 90%) - Upload coverage to Codecov - Add 10 minute timeout Closes #46, closes #47, closes #48
42 lines
1004 B
YAML
42 lines
1004 B
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v3
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "requirements.txt"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install --system -r requirements.txt
|
|
uv pip install --system pytest pytest-cov
|
|
|
|
- name: Run tests with coverage
|
|
run: pytest -v --cov=src --cov-report=xml --cov-report=term --cov-fail-under=60
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
files: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
token: ${{ secrets.CODECOV_TOKEN }} # Optional for public repos, but recommended
|