forked from mtusi2026/mtusi2026lab3
38 lines
1.7 KiB
YAML
38 lines
1.7 KiB
YAML
name: Application stack
|
|
# Отдельный job решения: сборка образа API, Compose-стенд (LB + 2 реплики + migrate + PostgreSQL + Redis),
|
|
# публичные smoke/persistence/failover и собственные проверки. Секреты синтетические, генерируются на лету.
|
|
on: [push, pull_request]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
stack:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Secrets and env (synthetic)
|
|
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
|
|
run: make test BASE_URL=http://127.0.0.1:8080
|
|
- name: Failover (stop one 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
|
|
cat evidence/failover-hook.txt
|
|
- name: Persistence (restart LB, replicas, PostgreSQL, Redis; volumes kept)
|
|
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://127.0.0.1:8080
|
|
- name: Student tests
|
|
run: make test-student
|
|
- name: Rolling update under load
|
|
run: python3 research/lb_experiments.py rolling-update
|
|
- name: Logs on failure
|
|
if: failure()
|
|
run: docker compose --env-file .env --profile ttl logs --no-color --tail=200
|
|
- name: Stop
|
|
if: always()
|
|
run: docker compose --env-file .env --profile ttl down -v
|