Use uv python pin + only-system preference to prevent uv from downloading a different Python version and wiping the venv.
38 lines
1.2 KiB
YAML
38 lines
1.2 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
|
|
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
|
|
commands:
|
|
- uv python pin 3.13.11
|
|
- uv sync --dev
|
|
- uv pip install -e .
|
|
- uv run pytest tests/ --no-cov --tb=short -q
|
|
|
|
- name: validate-compose
|
|
image: docker:cli
|
|
volumes:
|
|
- /run/user/1000/docker.sock:/var/run/docker.sock
|
|
commands:
|
|
- docker compose config --quiet
|