CI / ruff · mypy · pytest (pull_request) Failing after 3m40s
- app/pipeline: протокол CIProvider, клиент Gitea Actions (прогон по head_sha, упавший шаг, лог джоба, ретраи), PipelineWatcher — опрос только при незавершённых push, сообщение о push обновляется CI ⏳ → ✅/❌ → CD 🚀/⛔, автору — отдельные уведомления - деплой сервисов — только после зелёного CI; старый push не откатывает сервис, который развернёт более новый; после рестарта бот продолжает с того же места - CI_PROVIDER=none — прежнее поведение (деплой сразу после push) - шаблон tgit-uploads: .gitea/workflows/check.yml; .gitea/ защищён от правок из бота - миграция 0002: старые push помечены skipped, чтобы не слать им «таймаут CI» - ADR-016, ARCHITECTURE §2.5/§5.2, README, DEPLOY, .env.example Refs #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.2 KiB
YAML
53 lines
2.2 KiB
YAML
# 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:
|
|
# The API doesn't tell which commit a run is for — the bot reads it from this log (ADR-014). Keep it first.
|
|
- name: meta
|
|
image: ghcr.io/astral-sh/uv:0.8-python3.12-bookworm-slim
|
|
script:
|
|
- echo "TGIT_COMMIT_SHA=$SOURCECRAFT_COMMIT_SHA"
|
|
- name: compile
|
|
needs: ["-"]
|
|
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
|
|
# Разворачивает бот после зелёного check (tgit-runner, #13); здесь — только список для лога.
|
|
# Сейчас CI загрузок — Gitea Actions (.gitea/workflows/check.yml, ADR-016); этот файл — для возврата.
|
|
- 'echo "$(wc -l < changed.txt) service(s) changed — deployed by the bot via tgit-runner"'
|