Skip to content

docs(readme): add animated demo GIF touring the core screens #200

docs(readme): add animated demo GIF touring the core screens

docs(readme): add animated demo GIF touring the core screens #200

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# Gitleaks needs full history to scan diffs across the PR range.
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Dependency audit
# Surface high/critical advisories without blocking PRs. Several
# transitive deps (e.g. via sharp) periodically post warnings we
# cannot fix directly — keep this as a visible signal, then flip
# to required once the dep tree is consistently clean.
continue-on-error: true
run: npm audit --audit-level=high
- name: Secret scan (gitleaks)
# Catches accidental commits of .env files, API keys, tokens, etc.
# Fast (~5s on this repo). Runs before build so we fail early.
uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Type check
run: npm run check
- name: Lint
run: npm run lint
- name: Format check
run: npm run format:check
- name: Unit tests with coverage
# Placeholder URL satisfies the Neon driver when test files
# transitively import server modules. No connection is made.
run: npm run test:coverage
env:
DATABASE_URL: postgresql://placeholder:placeholder@placeholder/placeholder?sslmode=require
- name: Coverage summary
# Emit a small markdown table to the run summary so reviewers can
# see coverage percentages at a glance without downloading the
# artifact. Reads coverage/coverage-summary.json (produced by the
# `json-summary` reporter in vite.config.ts).
if: always()
run: |
node -e "
const fs = require('fs');
const path = 'coverage/coverage-summary.json';
if (!fs.existsSync(path)) {
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, '### Coverage\n\n_No coverage summary found._\n');
process.exit(0);
}
const total = JSON.parse(fs.readFileSync(path, 'utf8')).total;
const fmt = (m) => m && typeof m.pct === 'number' ? m.pct.toFixed(2) + '%' : 'n/a';
const md = [
'### Coverage',
'',
'| Metric | Coverage |',
'| --- | --- |',
'| Statements | ' + fmt(total.statements) + ' |',
'| Branches | ' + fmt(total.branches) + ' |',
'| Functions | ' + fmt(total.functions) + ' |',
'| Lines | ' + fmt(total.lines) + ' |',
'',
].join('\n');
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, md);
"
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage
retention-days: 30
- name: Build
# SvelteKit's analyse step loads server modules at build time,
# so the Neon driver instantiates from DATABASE_URL even though
# no DB connection is made. A syntactically-valid placeholder
# is enough to satisfy it.
run: npm run build
env:
DATABASE_URL: postgresql://placeholder:placeholder@placeholder/placeholder?sslmode=require
e2e:
# Playwright E2E suite. Gated on the RUN_E2E repo variable so the
# workflow is a no-op until a Neon test branch and the
# E2E_DATABASE_URL secret are configured. Without it, the rest of
# CI behaves identically to before.
name: E2E (Playwright)
runs-on: ubuntu-latest
needs: validate
timeout-minutes: 15
if: ${{ vars.RUN_E2E == 'true' }}
permissions:
contents: read
env:
# Both names are accepted by scripts/seed-e2e.ts and the helpers.
DATABASE_URL: ${{ secrets.E2E_DATABASE_URL }}
E2E_DATABASE_URL: ${{ secrets.E2E_DATABASE_URL }}
PUBLIC_BASE_URL: http://localhost:5173
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Seed E2E user
run: npm run seed:e2e
- name: Run Playwright tests
run: npm run test:e2e
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report
retention-days: 14