clipwright/.github/workflows/ci.yml
pedro-bento 0040aa49da
All checks were successful
CI / dashboard-e2e (push) Successful in 1m44s
CI / unit (push) Successful in 29s
CI / backend-e2e (push) Successful in 1m17s
test/e2e-coverage (#5)
Reviewed-on: #5
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:28:46 +01:00

80 lines
3.1 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
# 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 is
# intentionally absent from the unit environment.
run: pytest tests/ --ignore=tests/e2e -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