Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): overlap e2e static collection with database setup (#127037)

posthog[bot]8ce943bf84b6
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index f91574918b48..fc8293b63d07 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -887,28 +887,23 @@ jobs:
python manage.py setup_dev
- - name: Build frontend
+ - name: Build frontend and collect static files
run: |
pnpm --filter=@posthog/frontend... install --frozen-lockfile
pnpm --filter=@posthog/frontend build:products
pnpm --filter=@posthog/frontend build
- # collectstatic finishes before Start PostHog web, because each Granian worker loads
- # WhiteNoise, which reads STATIC_ROOT once when the worker starts (autorefresh is off
- # without DEBUG). WhiteNoise does not serve files that collectstatic writes after that.
- - parallel:
- - name: Collect static files without compression
- # The image-bitmap-data-url-worker-*.js.map files are already mirrored
- # into frontend/dist/ by copyRRWebWorkerFiles() in frontend/build.mjs
- # (see common/esbuilder/utils.mjs), which runs as part of the
- # `pnpm --filter=@posthog/frontend build` step above. No extra cp needed.
- env:
- STATIC_PRECOMPRESS: '0'
- run: python manage.py collectstatic --noinput
+ # The image-bitmap-data-url-worker-*.js.map files are already mirrored
+ # into frontend/dist/ by copyRRWebWorkerFiles() in frontend/build.mjs
+ # (see common/esbuilder/utils.mjs), which runs as part of the
+ # `pnpm --filter=@posthog/frontend build` step above. No extra cp needed.
+ # STATIC_COLLECTION skips startup side effects while migrations run.
+ STATIC_COLLECTION=1 STATIC_PRECOMPRESS=0 python manage.py collectstatic --noinput
- name: Install Playwright browsers
run: pnpm --filter=@posthog/playwright exec playwright install chromium --with-deps
+ # WhiteNoise reads STATIC_ROOT once at startup, so collection must finish before Granian starts.
- name: Source celery queues
run: |
source ./bin/celery-queues.env