feat(infra): шаблон репозитория загрузок tgit-uploads — CI/CD, служебные скрипты, демо-сервис

- .sourcecraft/ci.yaml: push в main → check (compile · ruff мягкий · bandit · pytest по сервисам) → deploy
- .tgit/changed_services.py: изменённые services/<name>/ (без родителя — все сервисы)
- .tgit/run_tests.py: pytest каждого сервиса со своими requirements.txt
- deploy пока заглушка со списком сервисов — tgit-runner в #13
- services/hello: демо-сервис с тестом; tgit.yaml — формат настроек сервиса

Refs #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 23:59:41 +03:00
co-authored by Claude Opus 5.5
parent bbd4ac5bc1
commit d4dba9748d
10 changed files with 200 additions and 2 deletions
@@ -0,0 +1,45 @@
# CI/CD репозитория загрузок tgit. Шаблон живёт в HSE/tgit: infra/uploads-template/ — правки делать там.
# Бот не даёт менять .sourcecraft/ и .tgit/ из Telegram (SPEC C-16).
on:
push:
- workflows: [check-and-deploy]
filter:
branches: ["main"]
workflows:
check-and-deploy:
settings:
max_cube_duration: 10m
tasks:
- name: check
cubes:
- name: compile
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim
script:
- python -m compileall -q -x '(^|/)\.' .
- name: lint
needs: ["-"]
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim
script:
- uvx ruff@0.13 check .
- name: security
needs: ["-"]
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim
script:
- uvx bandit@1.8 -q -r services -ll
- name: tests
needs: ["-"]
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim
script:
- python .tgit/run_tests.py
- name: deploy
needs: [check]
cubes:
- name: deploy
# full (non-slim) image: has git for diffing the pushed commit
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm
script:
- python .tgit/changed_services.py > changed.txt
- cat changed.txt
# Запуск через tgit-runner по SSH — #13. До этого — только список сервисов к развёртыванию.
- 'echo "deploy stub: $(wc -l < changed.txt) service(s) to deploy"'