clipwright/.github/workflows/ci.yml
pedro-bento 026f3ff271
Some checks failed
CI / unit (pull_request) Failing after 24s
CI / backend-e2e (pull_request) Successful in 1m18s
CI / dashboard-e2e (pull_request) Successful in 1m44s
test: add full E2E coverage (API, pipeline, browser)
Three-level end-to-end suite, all deterministic (no retries, no sleeps, no
unmocked network):

- tests/e2e/api (209 tests): every route in clipwright/api/app.py +
  free_tools — health/config, uploads, process submit matrix + worker/webhook/
  auto-retry/resume, status/source/download-all, edit/effects, transcript/EDL/
  rerender, scenes/reframe, subtitle, hook, Postiz, thumbnails, free tools,
  and the security/path guards.
- tests/e2e/pipeline (136 tests): every stage with real ffmpeg and stubbed
  Gemini/yt-dlp/ASR/ML — download, transcribe, scene detect, selection,
  layout, reframe/render, subtitles, hooks, watermark, thumbnails, plus the
  real CLI full pipeline via stub_env.
- dashboard/e2e (19 Playwright specs): route-interception state machine
  covering every dashboard flow; one real-backend spec left test.fixme.
- Foundation: tests/e2e/conftest.py (state isolation, no-network guard, ffmpeg
  media factory, disk-seeded jobs), FakePopen worker harness, child-process
  stub_env, architecture-consistent fixtures.
- CI: unit + backend-e2e + dashboard-e2e jobs in the python+node container;
  ffmpeg + Playwright installed in-job; no setup-node/cache (act runner).

Verified: unit 790 passed; API E2E 209 passed; pipeline E2E 136 passed;
Playwright 19 passed / 1 skipped.
2026-10-04 21:58:28 +01:00

76 lines
2.8 KiB
YAML

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, no pytest-timeout requirement.
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
- name: Install test dependencies
run: pip install -r requirements-test.txt
- name: Run unit tests
run: pytest tests/ -m "not e2e" -q
# Backend E2E: API + pipeline. ffmpeg/ffprobe must be installed in-job; the
# E2E requirements add 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 E2E dependencies
run: pip install -r requirements-e2e.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