Skip to content

Commit db19c0a

Browse files
Programcodeclaude
andcommitted
Cut the pull-request check to about 3 minutes and move slow suites to schedules
Quality now runs five parallel jobs with cached node_modules. Unit tests use Vitest's vmThreads pool (95s to 43s on 2 CPUs), and the @smoke set keeps boot, sign-in, every page render and the first-run tour; tool journeys stay nightly. The full-stack database gate, live providers, the agentic suite and the model matrix no longer run on pull requests. Schema PRs run pgTAP on Postgres alone. Staging E2E, the production canary and the preview note stop starting runs that only skip, and docs.yml folds into Quality. npm run verify runs in two lanes (231s to 98s locally). Prerender gets its own Vite cache so a build no longer breaks a running dev server's lazy routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 124b8b0 commit db19c0a

28 files changed

Lines changed: 381 additions & 247 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Node and dependencies
2+
description: >-
3+
Node 22 with node_modules restored from the cache for this lockfile. npm ci
4+
runs only on a cache miss, so most jobs skip its 40 seconds.
5+
6+
runs:
7+
using: composite
8+
steps:
9+
- name: Set up Node
10+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
11+
with:
12+
node-version: 22
13+
14+
- name: Restore node_modules
15+
id: cache
16+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
17+
with:
18+
path: node_modules
19+
key: node-modules-${{ runner.os }}-node22-${{ hashFiles('package-lock.json') }}
20+
21+
- name: Install dependencies
22+
if: steps.cache.outputs.cache-hit != 'true'
23+
shell: bash
24+
run: npm ci

‎.github/workflows/agentic-e2e.yml‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,13 @@ name: Agentic E2E
33
# The e2e suite in agentic/ against the local stack in fake mode: an AI agent
44
# drives goal-level flows and judges screens. Recorded flows replay from
55
# agentic/replay without model calls; judgments always call the model.
6-
# It runs nightly and on pull requests that touch the app or the suite. A
7-
# weekly bug bash sends each persona exploring, and on demand one exploration
8-
# runs instead of the suite.
6+
# It runs nightly, not on pull requests: it takes far longer than the
7+
# pull-request check and each judgment is a paid model call. Run it on a
8+
# branch with `gh workflow run agentic-e2e.yml --ref <branch>`. A weekly bug
9+
# bash sends each persona exploring, and on demand one exploration runs
10+
# instead of the suite.
911
# Not a required check. See docs/testing.md#agentic-browser-tests.
1012
on:
11-
pull_request:
12-
paths:
13-
- "src/**"
14-
- "packages/**"
15-
- "public/**"
16-
- "index.html"
17-
- "supabase/functions/**"
18-
- "supabase/migrations/**"
19-
- "package-lock.json"
20-
- "agentic/**"
21-
- "e2e.config.ts"
22-
- "e2e/full-stack/stack-core.ts"
23-
- "e2e/full-stack/fake-openrouter.mjs"
24-
- ".claude/skills/verify-debatelab/bin/verify.sh"
25-
- ".github/workflows/agentic-e2e.yml"
2613
schedule:
2714
- cron: "47 3 * * *" # the suite
2815
- cron: "13 5 * * 0" # the weekly bug bash
@@ -89,7 +76,7 @@ jobs:
8976
run: npx playwright install --with-deps chromium
9077

9178
# Without the key every agent test skips, which would read as a pass.
92-
# Same accepted risk as live-e2e.yml: pull-request code runs with it.
79+
# Same accepted risk as live-e2e.yml: a dispatch can run branch code with it.
9380
- name: Require the testing agent's model key
9481
env:
9582
LIVE_OPENROUTER_API_KEY: ${{ secrets.LIVE_OPENROUTER_API_KEY }}

‎.github/workflows/browser-nightly.yml‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Browser nightly
22

3-
# The full credential-free browser suite on desktop and mobile Chromium. Pull
4-
# requests run only the @smoke subset (deploy.yml), so this catches what the
5-
# subset skips, at most a day late.
3+
# The full credential-free browser suite on desktop and mobile Chromium, and
4+
# the service worker's offline test against a production build. Pull requests
5+
# run only the @smoke subset (deploy.yml), so this catches what the subset
6+
# skips, at most a day late. Run it on a branch with
7+
# `gh workflow run browser-nightly.yml --ref <branch>`.
68
on:
79
schedule:
810
- cron: "47 2 * * *"
@@ -25,14 +27,7 @@ jobs:
2527
with:
2628
persist-credentials: false
2729

28-
- name: Set up Node
29-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
30-
with:
31-
node-version: 22
32-
cache: npm
33-
34-
- name: Install dependencies
35-
run: npm ci
30+
- uses: ./.github/actions/node-deps
3631

3732
- name: Cache Playwright browsers
3833
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -50,6 +45,10 @@ jobs:
5045
PLAYWRIGHT_BASE_URL: http://127.0.0.1:18080
5146
run: npm run test:e2e
5247

48+
- name: Service worker offline test
49+
if: ${{ !cancelled() }}
50+
run: npm run build && npm run test:sw
51+
5352
- name: Upload browser failure artifacts
5453
if: failure()
5554
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/database.yml‎

Lines changed: 30 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,22 @@
11
name: Database
22

3-
# Local Supabase, pgTAP, and the full-stack browser journeys. About 20 minutes,
4-
# so pull requests run it only when they touch the backend, the stores and
5-
# clients that talk to it, or the gate itself. Pushes to main use the same
6-
# filter, and the weekly run catches frontend-only regressions.
3+
# Pull requests that change the schema, its tests, or the gate run pgTAP and
4+
# the database scripts against Postgres alone, about 2 minutes. The full gate
5+
# (local Supabase, pgTAP, and the full-stack browser journeys on desktop and
6+
# mobile, about 20 minutes) runs nightly and on demand.
77
on:
88
pull_request:
99
paths:
10-
- "supabase/**"
11-
- "services/collaboration/**"
12-
- "src/lib/supabase/**"
13-
- "src/lib/stores/**"
14-
- "src/lib/ai/**"
15-
- "packages/**"
16-
- "e2e/full-stack/**"
17-
- "e2e/workspace-collaboration.spec.ts"
18-
- "playwright.workspace.config.ts"
19-
- ".superset/db-gate.sh"
20-
- ".superset/lib/**"
21-
- ".superset/workspace-test.env"
10+
- "supabase/migrations/**"
11+
- "supabase/tests/**"
12+
- "supabase/seed.sql"
13+
- "supabase/config.toml"
2214
- "scripts/test-*.sh"
23-
- "scripts/workspace-test-env.mjs"
24-
- "package.json"
25-
- "package-lock.json"
26-
- ".github/workflows/database.yml"
27-
push:
28-
branches: [ "main" ]
29-
paths:
30-
- "supabase/**"
31-
- "services/collaboration/**"
32-
- "src/lib/supabase/**"
33-
- "src/lib/stores/**"
34-
- "src/lib/ai/**"
35-
- "packages/**"
36-
- "e2e/full-stack/**"
37-
- "e2e/workspace-collaboration.spec.ts"
38-
- "playwright.workspace.config.ts"
3915
- ".superset/db-gate.sh"
4016
- ".superset/lib/**"
41-
- ".superset/workspace-test.env"
42-
- "scripts/test-*.sh"
43-
- "scripts/workspace-test-env.mjs"
44-
- "package.json"
45-
- "package-lock.json"
4617
- ".github/workflows/database.yml"
4718
schedule:
48-
- cron: "23 5 * * 0"
19+
- cron: "23 5 * * *"
4920
workflow_dispatch:
5021

5122
permissions:
@@ -55,27 +26,38 @@ concurrency:
5526
group: ${{ github.workflow }}-${{ github.ref }}
5627
cancel-in-progress: true
5728

29+
env:
30+
# ghcr.io rate-limits shared runners; the same images are on ECR.
31+
SUPABASE_INTERNAL_IMAGE_REGISTRY: public.ecr.aws
32+
5833
jobs:
59-
database-tests:
34+
pgtap:
35+
if: github.event_name == 'pull_request'
6036
runs-on: ubuntu-latest
37+
timeout-minutes: 10
6138
steps:
6239
- name: Checkout code
6340
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6441
with:
6542
persist-credentials: false
6643

67-
- name: Set up Node
68-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
69-
with:
70-
node-version: 22
44+
# The gate runs the repo-pinned Supabase CLI from node_modules.
45+
- uses: ./.github/actions/node-deps
7146

72-
- name: Set up Supabase CLI
73-
uses: supabase/setup-cli@46f7f98c7f948ad727d22c1e67fab04c223a0520 # v3.0.0
47+
- name: pgTAP and database scripts
48+
run: ./.superset/db-gate.sh --db-only
49+
50+
full-gate:
51+
if: github.event_name != 'pull_request'
52+
runs-on: ubuntu-latest
53+
timeout-minutes: 45
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
7457
with:
75-
version: 2.121.0
58+
persist-credentials: false
7659

77-
- name: Install dependencies
78-
run: npm ci
60+
- uses: ./.github/actions/node-deps
7961

8062
- name: Cache Playwright browsers
8163
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -88,8 +70,6 @@ jobs:
8870

8971
- name: Database and real workspace journey
9072
env:
91-
# ghcr.io rate-limits shared runners; the same images are on ECR.
92-
SUPABASE_INTERNAL_IMAGE_REGISTRY: public.ecr.aws
9373
WORKSPACE_GATE_ARTIFACT_ROOT: ${{ runner.temp }}/workspace-gate
9474
run: ./.superset/db-gate.sh
9575

‎.github/workflows/deploy.yml‎

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Quality
22

3+
# The pull-request check. Five jobs run side by side so the check takes as long
4+
# as the slowest one, about 2.5 minutes. Slow, paid, and full-stack suites run
5+
# on a schedule instead; docs/operations.md lists them.
36
on:
47
push:
58
branches: [ "main" ]
69
pull_request:
7-
# Docs-only pull requests run docs.yml instead.
8-
paths-ignore:
9-
- "docs/**"
10-
- "plans/**"
11-
- "**/*.md"
1210
workflow_dispatch:
1311

1412
permissions:
@@ -19,69 +17,91 @@ concurrency:
1917
cancel-in-progress: true
2018

2119
jobs:
22-
quality:
20+
lint:
2321
runs-on: ubuntu-latest
22+
timeout-minutes: 10
2423
steps:
2524
- name: Checkout code
2625
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2726
with:
2827
persist-credentials: false
2928

30-
- name: Set up Node
31-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
32-
with:
33-
node-version: 22
34-
cache: npm
35-
36-
- name: Install dependencies
37-
run: npm ci
38-
39-
- name: Set up Deno
40-
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
41-
with:
42-
deno-version: 2.9.6
43-
cache: true
29+
- uses: ./.github/actions/node-deps
4430

4531
- name: Documentation
4632
run: npm run docs:check
4733

4834
- name: Lint
4935
run: npm run lint
5036

37+
typecheck-build:
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 10
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43+
with:
44+
persist-credentials: false
45+
46+
- uses: ./.github/actions/node-deps
47+
5148
- name: Typecheck
5249
run: npm run typecheck
5350

51+
- name: Build
52+
run: npm run build
53+
54+
unit:
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
60+
with:
61+
persist-credentials: false
62+
63+
- uses: ./.github/actions/node-deps
64+
5465
- name: Test
5566
run: npm test
5667

5768
- name: Collaboration service tests
5869
run: npm run test:collaboration
5970

71+
# Edge Function tests import only jsr:, npm: and https: modules, so this job
72+
# needs Deno and no npm install.
73+
edge:
74+
runs-on: ubuntu-latest
75+
timeout-minutes: 10
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
79+
with:
80+
persist-credentials: false
81+
82+
- name: Set up Deno
83+
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
84+
with:
85+
deno-version: 2.9.6
86+
cache: true
87+
6088
- name: Edge function tests
6189
run: npm run test:edge
6290

63-
- name: Build
64-
run: npm run build
65-
66-
# Runs beside quality so the pull-request check takes as long as the slower
67-
# of the two. The full desktop and mobile suite runs in browser-nightly.yml.
91+
# The @smoke set: the app boots, sign-in works, every public and signed-in
92+
# page renders without errors, and the first-run tour starts a debate. The
93+
# full desktop and mobile suite runs in browser-nightly.yml.
6894
browser-smoke:
6995
if: github.event_name == 'pull_request'
7096
runs-on: ubuntu-latest
97+
timeout-minutes: 10
7198
steps:
7299
- name: Checkout code
73100
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
74101
with:
75102
persist-credentials: false
76103

77-
- name: Set up Node
78-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
79-
with:
80-
node-version: 22
81-
cache: npm
82-
83-
- name: Install dependencies
84-
run: npm ci
104+
- uses: ./.github/actions/node-deps
85105

86106
- name: Cache Playwright browsers
87107
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0

‎.github/workflows/docs.yml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)