# Builds the application image and proves it works: the service starts, the web app is served, the practice pod # answers, and the self-tests pass inside the container (offline, then three real scenarios in Chromium). name: Container image on: push: branches: [main] workflow_dispatch: {} permissions: contents: read jobs: build-and-verify: runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v4 - name: Build the image run: docker build -t patch-coworker:ci . - name: Start the application run: | docker run -d --name app --shm-size=1g -p 8800:8800 \ -e FPT_ORCHESTRATOR=langgraph -e PLAYWRIGHT_MODE=stub -e FPT_CASE_WRITEBACK=0 -e PATCH_WATCH_ENABLED=0 \ -e FPT_BOOTSTRAP_ADMIN_USER=ci -e FPT_BOOTSTRAP_ADMIN_PASSWORD=ci-only-password-123 \ patch-coworker:ci for i in $(seq 1 60); do if curl -fsS http://127.0.0.1:8800/api/ready; then echo; exit 0; fi sleep 3 done echo "the application did not become ready"; docker logs app | tail -100; exit 1 - name: The web app is served run: curl -fsS http://127.0.0.1:8800/ | grep -q 'id="root"' - name: The practice pod answers inside the container run: docker exec app curl -fsS http://127.0.0.1:3100/api/health - name: Sign-in works run: | curl -fsS -X POST http://127.0.0.1:8800/api/auth/token -H 'Content-Type: application/json' \ -d '{"username":"ci","password":"ci-only-password-123"}' | grep -q access_token - name: Self-test (offline) run: docker exec app python -m coworker selftest - name: Self-test (three scenarios in Chromium) run: docker exec app python -m coworker selftest --live # The demo host (Render's free plan) gives the service 512 MB. Run the whole demo flow under that limit. - name: Demo rehearsal with 512 MB of memory run: | docker rm -f app docker run -d --name app --memory=512m --memory-swap=512m --cpus=0.5 -p 8800:8800 -e FPT_ORCHESTRATOR=langgraph -e PLAYWRIGHT_MODE=stub -e FPT_CASE_WRITEBACK=0 -e PATCH_WATCH_ENABLED=0 -e FPT_BOOTSTRAP_ADMIN_USER=ci -e FPT_BOOTSTRAP_ADMIN_PASSWORD=ci-only-password-123 patch-coworker:ci for i in $(seq 1 100); do curl -fsS http://127.0.0.1:8800/api/ready >/dev/null && break; sleep 3; done python3 deploy/smoke_run.py http://127.0.0.1:8800 ci ci-only-password-123 --timeout 900 python3 deploy/smoke_run.py http://127.0.0.1:8800 ci ci-only-password-123 --full --timeout 900 echo "killed for memory: $(docker inspect app --format '{{.State.OOMKilled}}') restarts: $(docker inspect app --format '{{.RestartCount}}')" test "$(docker inspect app --format '{{.State.OOMKilled}}')" = "false" docker stats app --no-stream --format 'memory in use after the rehearsal: {{.MemUsage}}' - name: Image size if: always() run: docker images patch-coworker:ci --format '{{.Size}}' - name: Application log on failure if: failure() run: docker logs app 2>&1 | tail -200