Files
mtusi2026lab2/.github/workflows/contracts.yml
2026-11-07 11:56:38 +03:00

40 lines
1.4 KiB
YAML

name: Skeleton contracts
on: [push, pull_request]
permissions:
contents: read
jobs:
contracts:
runs-on: ubuntu-latest
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
application:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install -r requirements-test.txt
- run: cp .env.example .env
- run: docker compose --env-file .env up -d --build
- name: Wait until API is ready
run: |
for i in $(seq 1 60); do
if curl -fsS http://127.0.0.1:8080/health/ready; then exit 0; fi
sleep 2
done
docker compose --env-file .env logs
exit 1
- run: make test PYTHON=python
- run: chmod +x scripts/restart.sh
- run: make test-persistence ACTION_SCRIPT=scripts/restart.sh PYTHON=python
- run: python -m pytest student_tests -q -m "not infra and not expiry"
- run: RUN_INFRA=1 python -m pytest student_tests/test_infra.py -q -m infra
- run: python scripts/run_expiry.py
- run: docker compose --env-file .env exec -T api python -m app.tools.explain