mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 13:20:39 -07:00
ci: unit, e2e, and backend-test jobs
quality keeps typecheck + web build and uploads the bundle. unit runs vitest (node + Chromium browser projects) and blocks PRs. e2e boots the CPU backend with fake TTS and runs Playwright against the preview build — informational until it has a sustained green run, then flip continue-on-error off. backend-tests runs the existing pytest suite for the first time in CI, also informational.
This commit is contained in:
+112
-3
@@ -7,9 +7,8 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
frontend-quality:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -22,5 +21,115 @@ jobs:
|
||||
- name: Typecheck app + web
|
||||
run: bun run typecheck
|
||||
|
||||
- name: Build web smoke test
|
||||
- name: Build web
|
||||
run: bun run build:web
|
||||
|
||||
- name: Upload web build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: web-dist
|
||||
path: web/dist
|
||||
retention-days: 1
|
||||
|
||||
unit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Cache Playwright browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}
|
||||
|
||||
- name: Install Chromium
|
||||
run: bunx playwright install chromium --with-deps
|
||||
|
||||
- name: Vitest (unit + browser)
|
||||
run: bunx vitest run
|
||||
|
||||
e2e:
|
||||
# Informational while the suite beds in; flip to blocking once it has
|
||||
# a sustained green run.
|
||||
continue-on-error: true
|
||||
needs: quality
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
cache: pip
|
||||
cache-dependency-path: backend/requirements-ci.txt
|
||||
|
||||
- name: Install backend (CPU)
|
||||
run: |
|
||||
pip install torch --index-url https://download.pytorch.org/whl/cpu
|
||||
pip install -r backend/requirements-ci.txt
|
||||
|
||||
- name: Cache Playwright browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}
|
||||
|
||||
- name: Install Chromium
|
||||
run: bunx playwright install chromium --with-deps
|
||||
|
||||
- name: Playwright E2E
|
||||
run: bunx playwright test -c e2e
|
||||
env:
|
||||
VOICEBOX_PYTHON: python
|
||||
|
||||
- name: Upload Playwright report
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-report
|
||||
path: |
|
||||
playwright-report
|
||||
test-results
|
||||
retention-days: 7
|
||||
|
||||
backend-tests:
|
||||
# Informational: 30 pre-existing pytest files that have never run in CI.
|
||||
continue-on-error: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
cache: pip
|
||||
cache-dependency-path: backend/requirements-ci.txt
|
||||
|
||||
- name: Install backend (CPU)
|
||||
run: |
|
||||
pip install torch --index-url https://download.pytorch.org/whl/cpu
|
||||
pip install -r backend/requirements-ci.txt
|
||||
pip install pytest pytest-asyncio
|
||||
|
||||
- name: Pytest
|
||||
run: python -m pytest backend/tests -v --ignore=backend/tests/test_all_models_e2e.py
|
||||
|
||||
Reference in New Issue
Block a user