Skip to content

chore: restore clean biome baseline #156

chore: restore clean biome baseline

chore: restore clean biome baseline #156

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [master, main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TELEMETRY_DISABLED: 1
NEXT_TELEMETRY_DISABLED: 1
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: starter_saas_ci
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Core vars only — POLAR_* / RESEND_* / R2_* are intentionally absent so CI
# proves the zero-key boot path (optional services degrade to "disabled").
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/starter_saas_ci
BETTER_AUTH_URL: http://localhost:3001
APP_URL: http://localhost:3001
CORS_ORIGIN: http://localhost:3001
NEXT_PUBLIC_APP_URL: http://localhost:3001
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10.30.3
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Materialize CI .env
# `@vibestack/env` calls `dotenv/config` on import, and Next 16 build
# workers don't always inherit the job-level `env:` block. Write the
# repo-root .env from those vars and symlink it into each app so server
# builds see the same vars as local dev.
run: |
cat > .env <<EOF
NODE_ENV=production
DATABASE_URL=${DATABASE_URL}
BETTER_AUTH_SECRET=$(openssl rand -base64 32)
BETTER_AUTH_URL=${BETTER_AUTH_URL}
APP_URL=${APP_URL}
CORS_ORIGIN=${CORS_ORIGIN}
NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
EOF
- run: pnpm install --frozen-lockfile
- run: pnpm run setup
- run: pnpm db:push
- run: pnpm check
- run: pnpm typecheck
- run: pnpm test
- run: pnpm build
smoke:
# Boots the web app with core-only env and asserts /api/health returns 200
# (optional services report "disabled" without failing the boot).
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: starter_saas_smoke
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/starter_saas_smoke
BETTER_AUTH_URL: http://localhost:3001
APP_URL: http://localhost:3001
CORS_ORIGIN: http://localhost:3001
NEXT_PUBLIC_APP_URL: http://localhost:3001
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10.30.3
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Materialize core-only .env
run: |
cat > .env <<EOF
NODE_ENV=production
DATABASE_URL=${DATABASE_URL}
BETTER_AUTH_SECRET=$(openssl rand -base64 32)
BETTER_AUTH_URL=${BETTER_AUTH_URL}
APP_URL=${APP_URL}
CORS_ORIGIN=${CORS_ORIGIN}
NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
EOF
- run: pnpm install --frozen-lockfile
- run: pnpm run setup
- run: pnpm db:push
- name: Build web only
run: pnpm --filter web... build
- name: Boot web and probe /api/health
run: |
PORT=3001 pnpm --filter web start &
SERVER_PID=$!
code=000
for i in $(seq 1 30); do
code=$(curl -s -o /tmp/health.json -w '%{http_code}' http://127.0.0.1:3001/api/health || true)
if [ "$code" = "200" ]; then
echo "health OK (HTTP $code):"
cat /tmp/health.json
kill "$SERVER_PID"
exit 0
fi
sleep 2
done
echo "health check failed (last HTTP code: $code)"
cat /tmp/health.json 2>/dev/null || true
kill "$SERVER_PID" 2>/dev/null || true
exit 1