- Upload badge SVG to Gitea generic package registry for stable URL - Set UV_PROJECT_ENVIRONMENT=.venv so test reuses lint's installed env - Remove redundant uv sync/pip install from test and coverage-badge steps
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
# ── Quality gate ─────────────────────────────────────────────────
|
|
# Runs on every push and PR. Must pass before merge to main.
|
|
# Gitea branch protection requires this pipeline's status checks.
|
|
|
|
when:
|
|
- event: [push, pull_request, manual]
|
|
|
|
steps:
|
|
- name: lint
|
|
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
|
|
environment:
|
|
UV_PYTHON_PREFERENCE: only-system
|
|
UV_LINK_MODE: copy
|
|
UV_PROJECT_ENVIRONMENT: .venv
|
|
commands:
|
|
- uv python pin 3.13.11
|
|
- uv sync --dev
|
|
- uv pip install -e .
|
|
- uv run ruff check src/ tests/ --output-format=concise
|
|
- uv run ruff format --check src/ tests/
|
|
|
|
- name: test
|
|
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
|
|
environment:
|
|
UV_PYTHON_PREFERENCE: only-system
|
|
UV_LINK_MODE: copy
|
|
UV_PROJECT_ENVIRONMENT: .venv
|
|
commands:
|
|
- uv run pytest tests/ --cov=src --cov-report=term-missing --cov-fail-under=99 -q 2>&1 | tee pytest.out
|
|
- uv run python dev/scripts/coverage_badge.py < pytest.out > coverage.svg
|
|
depends_on:
|
|
- lint
|
|
|
|
- name: coverage-badge
|
|
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
|
|
failure: ignore
|
|
environment:
|
|
UV_PYTHON_PREFERENCE: only-system
|
|
UV_LINK_MODE: copy
|
|
UV_PROJECT_ENVIRONMENT: .venv
|
|
GITEA_TOKEN:
|
|
from_secret: gitea_token
|
|
GITEA_URL:
|
|
from_secret: gitea_url
|
|
commands:
|
|
- uv run python dev/scripts/coverage_badge.py --post pytest.out
|
|
- uv run python dev/scripts/coverage_badge.py --upload coverage.svg
|
|
depends_on:
|
|
- test
|
|
|
|
- name: validate-compose
|
|
image: docker:cli
|
|
volumes:
|
|
- /run/user/1000/docker.sock:/var/run/docker.sock
|
|
commands:
|
|
- docker compose config --quiet
|