Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(ci): run independent workflow steps in parallel (#51398)

Alaister Young2b7f5ace512b
diff --git a/.github/workflows/docs-e2e.yml b/.github/workflows/docs-e2e.yml
index 289bb4aebeb..39c0c3ed5c4 100644
--- a/.github/workflows/docs-e2e.yml
+++ b/.github/workflows/docs-e2e.yml
@@ -146,6 +146,8 @@ jobs:
if: steps.scope.outputs.skip == 'false' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.changes.outputs.docs_app == 'true'
id: deployment
continue-on-error: true
+ # Polls for minutes; install deps and Chromium while it does.
+ background: true
run: node scripts/waitForVercelPreview.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -155,6 +157,17 @@ jobs:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
+ - name: Install dependencies
+ if: steps.scope.outputs.skip == 'false'
+ run: pnpm install --frozen-lockfile --filter=e2e-docs...
+
+ - name: Install Playwright Chromium
+ if: steps.scope.outputs.skip == 'false'
+ run: pnpm -C e2e/docs exec playwright install chromium --with-deps --only-shell
+
+ - name: Wait for Vercel docs preview to finish
+ wait: [deployment]
+
- name: Resolve base URL
if: steps.scope.outputs.skip == 'false'
id: base-url
@@ -207,14 +220,6 @@ jobs:
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- - name: Install dependencies
- if: steps.base-url.outputs.should_test == 'true'
- run: pnpm install --frozen-lockfile --filter=e2e-docs...
-
- - name: Install Playwright Chromium
- if: steps.base-url.outputs.should_test == 'true'
- run: pnpm -C e2e/docs exec playwright install chromium --with-deps --only-shell
-
- name: Run docs E2E
if: steps.base-url.outputs.should_test == 'true'
working-directory: e2e/docs
diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml
index 967b2875f01..8acf713169a 100644
--- a/.github/workflows/docs-tests.yml
+++ b/.github/workflows/docs-tests.yml
@@ -16,6 +16,7 @@ on:
- 'e2e/docs/local-smoke/**'
- 'e2e/docs/playwright.local-smoke.config.ts'
- 'e2e/docs/package.json'
+ - '.github/workflows/docs-tests.yml'
# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
@@ -57,27 +58,29 @@ jobs:
- name: Install deps
run: pnpm install --frozen-lockfile
- - name: Check access-control partials
- run: |
- make -C apps/docs/spec generate.partials.access-control
- git diff --exit-code -- \
- apps/docs/content/_partials/access-control/scoped_pat_permissions.mdx \
- apps/docs/content/_partials/access-control/scoped_pat_mcp_tools.mdx
-
- - name: Download JS reference TypeDoc dumps
- # The source dumps under apps/docs/spec/reference/<lib>/<ver>/*.json are
- # gitignored — `make download.tsdoc.v2` re-fetches them from
- # supabase.github.io so the reference-content snapshot test has
- # something to walk.
- working-directory: apps/docs/spec
- run: make download.tsdoc.v2
-
- - name: Generate Dart reference dump
- # Dart has no upstream TypeDoc dump; its gitignored dump is generated
- # from the committed `supabase_dart_v2.yml` so the reference-content
- # snapshot test has something to walk.
- working-directory: apps/docs
- run: pnpm run codegen:references:dart
+ # Independent prep: a codegen diff check, a download, and a local codegen.
+ - parallel:
+ - name: Check access-control partials
+ run: |
+ make -C apps/docs/spec generate.partials.access-control
+ git diff --exit-code -- \
+ apps/docs/content/_partials/access-control/scoped_pat_permissions.mdx \
+ apps/docs/content/_partials/access-control/scoped_pat_mcp_tools.mdx
+
+ - name: Download JS reference TypeDoc dumps
+ # The source dumps under apps/docs/spec/reference/<lib>/<ver>/*.json are
+ # gitignored — `make download.tsdoc.v2` re-fetches them from
+ # supabase.github.io so the reference-content snapshot test has
+ # something to walk.
+ working-directory: apps/docs/spec
+ run: make download.tsdoc.v2
+
+ - name: Generate Dart reference dump
+ # Dart has no upstream TypeDoc dump; its gitignored dump is generated
+ # from the committed `supabase_dart_v2.yml` so the reference-content
+ # snapshot test has something to walk.
+ working-directory: apps/docs
+ run: pnpm run codegen:references:dart
- name: Run tests
run: |
diff --git a/.github/workflows/studio-e2e-test.yml b/.github/workflows/studio-e2e-test.yml
index 9b7ba85b549..e562aeb437f 100644
--- a/.github/workflows/studio-e2e-test.yml
+++ b/.github/workflows/studio-e2e-test.yml
@@ -74,8 +74,12 @@ jobs:
if: steps.filter.outputs.studio == 'true'
run: pnpm install --frozen-lockfile
+ # Chromium install, `supabase start` and the Studio build don't depend on
+ # each other, so run them side by side and wait before the tests.
- name: Install Playwright Browsers
if: steps.filter.outputs.studio == 'true'
+ id: playwright-install
+ background: true
run: pnpm -C e2e/studio exec playwright install chromium --with-deps --only-shell
- name: Set up NextJS/Turbo cache
@@ -111,23 +115,47 @@ jobs:
- name: Start supabase
if: steps.filter.outputs.studio == 'true'
- run: SKIP_ASSET_UPLOAD=1 pnpm run e2e:setup:cli
-
- - name: Failure diagnostics
- if: failure()
+ id: supabase
+ background: true
run: |
- docker ps -a
- sudo ss -tlnp | grep 54322 || echo "54322 not listening"
- docker logs $(docker ps -aq) 2>&1 || true
+ pnpm exec supabase stop --all --no-backup --workdir ./e2e/studio || true
+ pnpm exec supabase start --exclude studio,mailpit --workdir ./e2e/studio
- name: Build studio
if: steps.filter.outputs.studio == 'true'
+ # The build runs before `supabase status` can report keys. It only
+ # inlines NEXT_PUBLIC_* vars, and the only one derived from status is
+ # the API URL, fixed by e2e/studio/supabase/config.toml. So build
+ # against that URL and check it against the real value once supabase is up.
+ #
# `MODE=test` so the Vite build (TanStack) loads `.env.test` for env
# resolution; Next ignores it but reads `NODE_ENV=test` for the same
# purpose. Vite's `vite.config.ts` overrides the bundle NODE_ENV to
# 'production' regardless of input, mirroring Next's build behaviour
# so vitest-only constants (e.g. `API_URL`) don't bleed in here.
- run: SKIP_ASSET_UPLOAD=1 NODE_ENV=test MODE=test NODE_OPTIONS="--max-old-space-size=4096" pnpm run build:studio
+ run: |
+ echo '{"API_URL":"http://127.0.0.1:54321"}' > keys.json
+ node scripts/generateLocalEnv.js
+ grep '^NEXT_PUBLIC_' apps/studio/.env.test | sort > "$RUNNER_TEMP/build-public-env"
+ SKIP_ASSET_UPLOAD=1 NODE_ENV=test MODE=test NODE_OPTIONS="--max-old-space-size=4096" pnpm run build:studio
+
+ - name: Wait for supabase and Playwright browsers
+ wait: [supabase, playwright-install]
+
+ - name: Failure diagnostics
+ if: failure()
+ run: |
+ docker ps -a
+ sudo ss -tlnp | grep 54322 || echo "54322 not listening"
+ docker logs $(docker ps -aq) 2>&1 || true
+
+ - name: Write runtime env
+ if: steps.filter.outputs.studio == 'true'
+ run: |
+ pnpm exec supabase status --output json --workdir ./e2e/studio > keys.json
+ node scripts/generateLocalEnv.js
+ # Fail if the build inlined NEXT_PUBLIC_* values that differ from the real ones.
+ diff "$RUNNER_TEMP/build-public-env" <(grep '^NEXT_PUBLIC_' apps/studio/.env.test | sort)
- name: 🚀 Run Playwright tests against local studio build
if: steps.filter.outputs.studio == 'true'
diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml
index 41817e88c20..4ffff7eda77 100644
--- a/.github/workflows/typecheck.yml
+++ b/.github/workflows/typecheck.yml
@@ -16,7 +16,7 @@ permissions:
jobs:
typecheck:
- runs-on: blacksmith-2vcpu-ubuntu-2404
+ runs-on: blacksmith-4vcpu-ubuntu-2404
env:
NODE_OPTIONS: --max-old-space-size=4096
@@ -46,10 +46,13 @@ jobs:
- name: Install deps
run: pnpm install --frozen-lockfile
- - name: Run TypeScript type check
- run: pnpm run typecheck
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # Independent turbo pipelines, run side by side so a typecheck failure
+ # doesn't hide lint errors.
+ - parallel:
+ - name: Run TypeScript type check
+ run: pnpm run typecheck
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Run Lint
- run: pnpm run lint
+ - name: Run Lint
+ run: pnpm run lint
diff --git a/.github/workflows/www-e2e.yml b/.github/workflows/www-e2e.yml
index 2d52534798d..183f6453184 100644
--- a/.github/workflows/www-e2e.yml
+++ b/.github/workflows/www-e2e.yml
@@ -128,6 +128,8 @@ jobs:
if: steps.scope.outputs.skip == 'false' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.changes.outputs.www_app == 'true'
id: deployment
continue-on-error: true
+ # Polls for minutes; install deps and Chromium while it does.
+ background: true
run: node scripts/waitForVercelPreview.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -137,6 +139,17 @@ jobs:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
+ - name: Install dependencies
+ if: steps.scope.outputs.skip == 'false'
+ run: pnpm install --frozen-lockfile --filter=e2e-www...
+
+ - name: Install Playwright Chromium
+ if: steps.scope.outputs.skip == 'false'
+ run: pnpm -C e2e/www exec playwright install chromium --with-deps --only-shell
+
+ - name: Wait for Vercel www preview to finish
+ wait: [deployment]
+
- name: Resolve base URL
if: steps.scope.outputs.skip == 'false'
id: base-url
@@ -184,14 +197,6 @@ jobs:
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- - name: Install dependencies
- if: steps.base-url.outputs.should_test == 'true'
- run: pnpm install --frozen-lockfile --filter=e2e-www...
-
- - name: Install Playwright Chromium
- if: steps.base-url.outputs.should_test == 'true'
- run: pnpm -C e2e/www exec playwright install chromium --with-deps --only-shell
-
- name: Run www E2E
if: steps.base-url.outputs.should_test == 'true'
working-directory: e2e/www