forked from mtusi2026/mtusi2026lab2
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
name: Application
|
|
on: [push, pull_request]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
app:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Bootstrap local env and secrets
|
|
run: make bootstrap
|
|
- name: Start stack
|
|
run: docker compose --env-file .env up -d --build
|
|
- name: Wait for readiness
|
|
run: |
|
|
for i in $(seq 1 60); do
|
|
if curl -fsS http://localhost:8080/health/ready; then exit 0; fi
|
|
sleep 2
|
|
done
|
|
docker compose --env-file .env ps
|
|
docker compose --env-file .env logs --tail=200
|
|
exit 1
|
|
- name: Migrations are idempotent
|
|
run: docker compose --env-file .env run --rm migrate
|
|
- name: Public smoke
|
|
run: make test PYTHON=python
|
|
- name: Own checks
|
|
run: make test-custom PYTHON=python
|
|
- name: Persistence with restart hook
|
|
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh PYTHON=python
|
|
- name: Logs on failure
|
|
if: failure()
|
|
run: docker compose --env-file .env logs --tail=200
|
|
- name: Tear down
|
|
if: always()
|
|
run: docker compose --env-file .env down -v
|