diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 584788c0..c726c859 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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