3274afb677
src/lib/server/env.ts validates DATABASE_URL, SESSION_SECRET, STORAGE_SIGNING_SECRET, and PUBLIC_BASE_URL with Zod and throws when missing. SvelteKit's analyse step imports it during build, so CI needs values that satisfy the schema shape — they never connect to anything. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Validate
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9.15.0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.node-version'
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run validation (svelte-check + build)
|
|
# Stub env so the build-time analyse step can import src/lib/server/env.ts
|
|
# without connecting to anything. Values match the Zod schema's shape only.
|
|
env:
|
|
DATABASE_URL: postgres://ci:ci@localhost:5432/ci
|
|
SESSION_SECRET: 0000000000000000000000000000000000000000000000000000000000000000
|
|
STORAGE_SIGNING_SECRET: 0000000000000000000000000000000000000000000000000000000000000000
|
|
PUBLIC_BASE_URL: http://localhost:5173
|
|
run: pnpm run validate
|