name: CI on: push: branches: [main] pull_request: env: PYTHONHASHSEED: "0" TZ: UTC PIP_DISABLE_PIP_VERSION_CHECK: "1" jobs: # Fast unit suite. No ffmpeg, no ML stack. unit: runs-on: ubuntu-latest timeout-minutes: 15 # The Forgejo runner cannot provision Python 3.11 via actions/setup-python # ("Version 3.11 was not found in the local cache"), so every job runs in a # container that already has Python 3.11. It must also ship Node and git: # the runner executes JS actions (actions/checkout) by invoking `node` # inside the job container. container: nikolaik/python-nodejs:python3.11-nodejs20 steps: - uses: actions/checkout@v4 # scenedetect (in requirements-test.txt) pulls the full opencv-python, # whose cv2 binary links libGL.so.1 — absent from the base image. The # pipeline modules the unit tests import need it at import time. - name: Install opencv system libs run: apt-get update -qq && apt-get install -y -qq --no-install-recommends libgl1 - name: Install test dependencies run: pip install -r requirements-test.txt - name: Run unit tests # Exclude the E2E tree from *collection*: `-m "not e2e"` only filters # execution, but pytest still imports every module to collect it, and # the pipeline E2E modules import the pipeline (tqdm/scenedetect/ML), # which would pull in fixtures the unit suite does not exercise. run: pytest tests/ --ignore=tests/e2e -m "not e2e" -q # Backend E2E: API + pipeline. ffmpeg/ffprobe must be installed in-job. # requirements-test.txt already carries pytest-asyncio/asgi-lifespan/ # pytest-timeout and the pure-Python scene engine. API and pipeline run as # separate processes so the pipeline tests' fake `clipwright.pipeline.main` # can never leak into the API process. No ML stack: detectors are stubbed, # only ffmpeg is real. backend-e2e: runs-on: ubuntu-latest timeout-minutes: 30 container: nikolaik/python-nodejs:python3.11-nodejs20 steps: - uses: actions/checkout@v4 - name: Install ffmpeg run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ffmpeg && ffmpeg -version | head -1 - name: Install test dependencies run: pip install -r requirements-test.txt - name: Run API E2E run: pytest tests/e2e/api -m e2e -q --timeout=120 - name: Run pipeline E2E (non-ML) run: pytest tests/e2e/pipeline -m "e2e and not ml" -q --timeout=120 # Dashboard E2E (Playwright). The container already ships Node 20 + npm + git, # so actions/setup-node and actions/cache are deliberately NOT used (their # Node download / cache endpoints time out against the act runner: # "connect ETIMEDOUT 172.27.0.4:41759"). Playwright is retry-free by config; # install browsers fresh each run. dashboard-e2e: runs-on: ubuntu-latest timeout-minutes: 30 container: nikolaik/python-nodejs:python3.11-nodejs20 defaults: run: working-directory: dashboard steps: - uses: actions/checkout@v4 - name: Install ffmpeg (E2E media fixture) run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ffmpeg - name: Install dependencies run: npm ci - name: Install Playwright browsers run: npx playwright install --with-deps chromium - name: Lint run: npm run lint - name: Build run: npm run build - name: Browser E2E run: npm run test:e2e