CI has been red since the July layout work: the workflow installed five light packages while the suite grew tests importing numpy, and the MCP endpoint tests added fastapi on top. Two fixes: - panel_layout/screencast_layout imported main (torch, mediapipe) BEFORE their ENABLED gate, so even the disabled path paid the heavy import. Move the import below the gate: the default path now imports nothing, which is what the gate was for. - The workflow installs exactly what the collected tests import at module level, still excluding the ML stack the lazy imports protect. List validated against a clean venv: 382 passed, 3 skipped, 0 import errors.
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
backend-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
# Everything the collected tests import at module level, WITHOUT the
|
|
# heavy ML stack (torch/ultralytics/mediapipe/faster-whisper) — the
|
|
# pipeline modules import those lazily behind their feature gates, and
|
|
# the tests exercise the gated-off paths. numpy+opencv cover the layout
|
|
# modules, fastapi/boto3/PyJWT/python-multipart cover importing app.py
|
|
# for the MCP endpoint tests, google-genai covers gemini_worker.
|
|
- name: Install test dependencies
|
|
run: >
|
|
pip install pytest pillow httpx pydantic sqlalchemy numpy
|
|
opencv-python-headless python-dotenv google-genai fastapi boto3
|
|
PyJWT email-validator python-multipart
|
|
- name: Run tests
|
|
run: pytest tests/ -v
|
|
|
|
frontend-build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: dashboard
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
cache-dependency-path: dashboard/package-lock.json
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build
|
|
run: npm run build
|