Files
mtusi2026lab6/.github/workflows/application.yml

36 lines
1.3 KiB
YAML

name: Lab 6 application and telemetry
on: [push, pull_request]
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install -r requirements-dev.txt
- run: make check validate PYTHON=python
- name: Start disposable stack
run: |
cp .env.example .env
python scripts/setup-local-secrets.py
python scripts/init_local_broker.py
docker compose -f compose.yaml -f compose.telemetry.yaml --env-file .env up -d --build --wait --scale api=2
- name: Verify API and telemetry rules
run: |
make test
python - <<'PY'
import json, urllib.request
url = 'http://127.0.0.1:9090/api/v1/rules'
data = json.load(urllib.request.urlopen(url, timeout=10))
assert data['status'] == 'success'
names = {rule['name'] for group in data['data']['groups'] for rule in group['rules']}
assert {'Lab6HighHttpErrorRate', 'Lab6QueueLag'} <= names, names
PY
- name: Stop stack
if: always()
run: docker compose -f compose.yaml -f compose.telemetry.yaml --env-file .env down || true