Setup/core services revamp #25
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Docker Compose | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| jobs: | |
| test-docker-compose: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - run: docker compose build | |
| - run: docker compose down -v --remove-orphans | |
| - run: docker compose up -d --wait backend adminer | |
| - name: Wait for backend health endpoint | |
| run: | | |
| set -e | |
| echo "Waiting for backend health endpoint..." | |
| for i in {1..24}; do | |
| if curl -fsS http://localhost:8000/api/v1/utils/health-check; then | |
| echo "backend healthy" | |
| break | |
| fi | |
| echo "Waiting for backend... ($i/24)" | |
| sleep 5 | |
| done | |
| - name: Run tests with coverage | |
| run: | | |
| # Install test/dev deps from pyproject (. [dev]) inside the backend container, then run tests | |
| docker compose run --rm backend bash -lc "python -m ensurepip || true; python -m pip install --upgrade pip setuptools; python -m pip install --no-cache-dir '.[dev]'; python -m coverage run -m pytest --maxfail=1 -q --disable-warnings && python -m coverage xml -o coverage.xml && python -m coverage html -d coverage_html" | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: | | |
| coverage.xml | |
| coverage_html | |
| - run: docker compose down -v --remove-orphans |