From 9e13da018903d769228ba9a1f5585db05ec3c1e4 Mon Sep 17 00:00:00 2001 From: Lacky1234union Date: Tue, 13 Oct 2026 23:39:05 +0300 Subject: [PATCH] =?UTF-8?q?ci:=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B1=D0=BE=D1=82=D0=B0=20=D0=B2=20SourceCraft?= =?UTF-8?q?=20CI=20=E2=80=94=20ruff,=20mypy,=20pytest=20=D1=81=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D0=BE=D0=B3=D0=BE=D0=BC=20=D0=BF=D0=BE=D0=BA=D1=80?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit push в любую ветку (зеркало из Gitea, ADR-010) → кубы lint и test параллельно. Порог покрытия — храповик в pyproject (fail_under), одинаков локально и в CI. Refs #6 Co-Authored-By: Claude Opus 5.5 --- .sourcecraft/ci.yaml | 33 +++++++++++++++++++++++++++++++++ pyproject.toml | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 .sourcecraft/ci.yaml diff --git a/.sourcecraft/ci.yaml b/.sourcecraft/ci.yaml new file mode 100644 index 0000000..bc3b21c --- /dev/null +++ b/.sourcecraft/ci.yaml @@ -0,0 +1,33 @@ +# CI бота. Код приходит push-зеркалом из Gitea (ADR-010): PR живут в Gitea, поэтому +# триггер pull_request здесь не сработает — проверяем каждый push в любую ветку. +# Деплой на хост (workflow deploy на push в main) — #12. +on: + push: + - workflows: [check] + filter: + branches: ["**"] + +workflows: + check: + settings: + max_cube_duration: 10m + tasks: + - name: quality + cubes: + - name: lint + image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim + env: + UV_LINK_MODE: copy + script: + - uv sync --frozen + - uv run ruff check . + - uv run ruff format --check . + - uv run mypy + - name: test + needs: ["-"] + image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim + env: + UV_LINK_MODE: copy + script: + - uv sync --frozen + - uv run pytest -q --cov --cov-report=term diff --git a/pyproject.toml b/pyproject.toml index 6f542b0..c271ab6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,10 @@ testpaths = ["tests"] [tool.coverage.run] source = ["app"] branch = true +omit = ["app/__main__.py"] [tool.coverage.report] show_missing = true skip_covered = true +# Ratchet: raise as code lands, never lower. Target by M4 — 70 (SPEC §5.2). +fail_under = 45