Skip to content

test: isolate qa review workbench e2e #392

test: isolate qa review workbench e2e

test: isolate qa review workbench e2e #392

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
static:
name: Static Gateway
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: tree:0
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Codegen Check
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon run root:codegen-check
- name: Format Check (affected)
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon ci :fmt-check
- name: Typecheck (affected)
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon ci :typecheck
- name: Lint (affected)
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon ci :lint
unit-tests:
name: Unit Tests
needs: static
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: tree:0
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run Unit Tests (affected)
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon ci :test-unit
pglite-compat:
name: PGlite Compatibility (non-blocking)
needs: static
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: tree:0
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run PGlite Compatibility Gate
run: pnpm exec tsx scripts/pglite-compat-gate.ts | tee pglite-compat-report.json
- name: Upload PGlite Compatibility Report
uses: actions/upload-artifact@v5
with:
name: pglite-compat-report
path: pglite-compat-report.json
integration-tests:
name: Integration Tests
needs: static
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: tree:0
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Postgres Search Runtime
run: docker build -t cat-postgres-search-runtime apps/postgres-search-runtime
- name: Run Postgres Search Runtime
run: |
docker run -d --name cat-search-runtime \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=pass \
-e POSTGRES_DB=cat \
-p 5432:5432 \
cat-postgres-search-runtime
- name: Wait for Postgres Search Runtime
timeout-minutes: 2
run: |
for _ in $(seq 1 30); do
status="$(docker inspect -f '{{.State.Health.Status}}' cat-search-runtime)"
if [ "$status" = "healthy" ]; then
if python3 -c "import socket; socket.create_connection(('127.0.0.1', 5432), timeout=1).close()" >/dev/null 2>&1; then
exit 0
fi
fi
if [ "$status" = "unhealthy" ]; then
docker logs cat-search-runtime
exit 1
fi
sleep 2
done
docker logs cat-search-runtime
exit 1
- name: Run Integration Tests (affected)
env:
TEST_DATABASE_URL: "postgres://user:pass@localhost:5432/cat"
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon ci :test-integration
e2e-tests:
name: E2E Tests
needs: static
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: tree:0
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Postgres Search Runtime
run: docker build -t cat-postgres-search-runtime apps/postgres-search-runtime
- name: Run Postgres Search Runtime
run: |
docker run -d --name cat-search-runtime-e2e \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=pass \
-e POSTGRES_DB=cat \
-p 5432:5432 \
cat-postgres-search-runtime
- name: Wait for Postgres Search Runtime
timeout-minutes: 2
run: |
for _ in $(seq 1 30); do
status="$(docker inspect -f '{{.State.Health.Status}}' cat-search-runtime-e2e)"
if [ "$status" = "healthy" ]; then
if python3 -c "import socket; socket.create_connection(('127.0.0.1', 5432), timeout=1).close()" >/dev/null 2>&1; then
exit 0
fi
fi
if [ "$status" = "unhealthy" ]; then
docker logs cat-search-runtime-e2e
exit 1
fi
sleep 2
done
docker logs cat-search-runtime-e2e
exit 1
- name: Push Database Schema
run: |
set +e
pnpm moon run db:push --quiet > /tmp/db-push.log 2>&1
status=$?
cat /tmp/db-push.log
if [ "$status" -ne 0 ]; then
summary="$(tail -n 20 /tmp/db-push.log)"
summary="${summary//'%'/'%25'}"
summary="${summary//$'\n'/'%0A'}"
summary="${summary//$'\r'/'%0D'}"
echo "::error title=Push Database Schema failed::$summary"
fi
exit "$status"
env:
DATABASE_URL: postgresql://user:pass@localhost:5432/cat?schema=public
- name: Install Playwright Browsers
run: |
for attempt in 1 2 3; do
pnpm exec playwright install --with-deps && exit 0
status=$?
if [ "$attempt" -eq 3 ]; then
exit "$status"
fi
echo "Playwright browser install failed on attempt $attempt; refreshing apt lists and retrying."
sudo rm -rf /var/lib/apt/lists/*
done
- name: Build App
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon run app:build
env:
DATABASE_URL: postgresql://user:pass@localhost:5432/cat?schema=public
CAT_RUNTIME_PROFILE: lite
CAT_SEARCH_REQUIREMENT: full-search-runtime
- name: Run App
working-directory: apps/app
run: |
pnpm exec tsx scripts/copy-drizzle.ts
NODE_ENV=production node dist/server/index.mjs > ../../app.log 2>&1 &
env:
PORT: 3000
DATABASE_URL: postgresql://user:pass@localhost:5432/cat?schema=public
CAT_RUNTIME_PROFILE: lite
CAT_SEARCH_REQUIREMENT: full-search-runtime
- name: Wait for Healthcheck
timeout-minutes: 3
run: |
echo "Waiting for service to be healthy..."
RETRIES=90
until curl --output /dev/null --silent --head --fail http://localhost:3000/_health; do
printf '.'
sleep 2
RETRIES=$((RETRIES-1))
if [ $RETRIES -le 0 ]; then
echo "Timeout waiting for service!"
echo "================ APPLICATION LOGS ================"
cat app.log
echo "=================================================="
exit 1
fi
done
echo "Server is up!"
- name: Run E2E Tests
run: MOON_OUTPUT_STYLE=buffer-only-failure pnpm moon run app-e2e:test-e2e
env:
PORT: 3000
DATABASE_URL: postgresql://user:pass@localhost:5432/cat?schema=public
CAT_RUNTIME_PROFILE: lite
CAT_SEARCH_REQUIREMENT: full-search-runtime
PW_REUSE_EXISTING_SERVER: "true"
E2E_SKIP_DB_CHECK: "true"
- name: Upload Playwright Report
if: failure()
uses: actions/upload-artifact@v5
with:
name: playwright-report
path: apps/app-e2e/playwright-report/
retention-days: 30