feat(docker): Containerized EdgeFlow (compiler, API, frontend) #110
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: Web Stack CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install backend deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r backend/requirements.txt | |
| - name: Test backend | |
| env: | |
| PYTHONPATH: . | |
| run: pytest -q backend/tests --cov=backend --cov-report=xml --cov-fail-under=75 | |
| - name: Bandit security scan | |
| run: bandit -r backend -x backend/tests -q | |
| frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install | |
| working-directory: frontend | |
| run: | | |
| npm ci || npm install | |
| - name: Test | |
| working-directory: frontend | |
| run: npm test -- --coverage --passWithNoTests | |
| - name: E2E placeholder | |
| working-directory: frontend | |
| run: npm run test:e2e | |
| - name: Build | |
| working-directory: frontend | |
| run: npm run build | |
| integration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Compose build | |
| run: | | |
| docker compose version || true | |
| docker compose build || docker-compose build | |
| - name: Compose up | |
| run: docker compose up -d || docker-compose up -d | |
| - name: Wait for backend | |
| run: | | |
| ATTEMPTS=40 | |
| until curl -sf http://localhost:8000/api/health; do | |
| ATTEMPTS=$((ATTEMPTS-1)) | |
| if [ $ATTEMPTS -le 0 ]; then | |
| echo "Backend did not become healthy" | |
| docker compose logs edgeflow-api || true | |
| exit 1 | |
| fi | |
| sleep 3 | |
| done | |
| - name: Smoke API | |
| run: | | |
| curl -sf http://localhost:8000/api/version | |
| - name: Compose down | |
| if: always() | |
| run: docker compose down -v || docker-compose down -v |