Files
mtusi2026lab5/.github/workflows/app.yml
T

40 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Application stack
# Отдельный job решения: сборка образа (API и worker), Compose-стенд (LB + 2 API + 2 worker + migrate +
# s3-init + broker-init + PostgreSQL + Redis + SeaweedFS S3 + NATS JetStream), публичные smoke/persistence/
# failover, сценарий защиты, отказы pipeline и трек 2. Секреты синтетические, генерируются на лету.
on: [push, pull_request]
permissions:
contents: read
jobs:
stack:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Secrets and env (synthetic; FAULT_HOOKS=lab for the failure tests)
run: ./scripts/init-secrets.sh
- name: Compose config
run: docker compose --env-file .env config --quiet
- name: Build and start
run: docker compose --env-file .env --profile ttl up -d --build --wait
- name: Public smoke via LB (202 → ready, original + JPEG thumbnail 256×160)
run: make test BASE_URL=http://127.0.0.1:8080
- name: Defense scenario (worker down → 202 → 409 → restart API+broker → worker → ready)
run: python3 student-tests/defense_demo.py
- name: Failover (stop one API replica), then restore
run: |
make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://127.0.0.1:8080
./scripts/start-replicas.sh
- name: Persistence (restart LB, API, worker, PostgreSQL, Redis, S3, NATS; volumes kept)
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://127.0.0.1:8080
- name: Student tests (pipeline, variants, crash windows, outbox, retry/DLQ/replay, lab2–4 regression)
run: make test-student
- name: Track 2 chaos (3 seeds) + invariants
run: make chaos
- name: Logs on failure
if: failure()
run: docker compose --env-file .env --profile ttl --profile fault logs --no-color --tail=200
- name: Stop
if: always()
run: docker compose --env-file .env --profile ttl --profile fault down -v