peppa/.gitea/workflows/ci.yml
Асель 3a282b8054 PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres
- packages/db: schema on sqlite-core (timestamps as epoch ms → Date, JSON as text,
  booleans 0/1), one baseline migration; node:sqlite client under drizzle's
  better-sqlite3 session (busy_timeout first, WAL, BEGIN IMMEDIATE, retries on
  SQLITE_BUSY, lazy open, async transaction callbacks refused); PEPPA_DB
  (default ~/.peppa/peppa.db)
- live updates: notify() pokes the bot over a unix socket; the bot also watches
  PRAGMA data_version every second (writes by other processes)
- Postgres specifics ported: createTask transaction is synchronous, no
  `for update skip locked`, `count(*)`, json_extract instead of ->>, json_each
  instead of @>
- `peppa db migrate` and `peppa db migrate-to-sqlite <file>` (read-only
  snapshot of Postgres, FK order from the schema, row count + foreign key
  checks, file appears only when they pass); old Postgres schema kept in
  packages/cli/legacy-pg-migrations for the migration and its test
- daily VACUUM INTO backup from the watchdog (7 copies, admin alert on failure)
- tests: a temp SQLite file per test file; storage.test.ts (20 processes,
  per-project numbering across processes, socket/data_version, migration from
  Postgres incl. a dangling foreign key, backups); two test races fixed
- CI: no per-run Postgres database; PEPPA_TEST_PG only for the migration test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:23:24 +05:00

51 lines
2.3 KiB
YAML

# CI for Peppa itself (PEP-22): typecheck, web build and the e2e suite on mocks. Runs on Peppa's
# act_runner (`peppa-trusted`, registered for peppa-bot's repos, PEP-57); tmux and the openspec
# CLI are installed in the job. Each check is a step of the factory's own pipeline (PEP-57):
# the commands are `checks` in .peppa/project.json, .gitea/peppa-check.sh (the template's) sets
# the `peppa/<check>` commit status and reports to Peppa, so PEP tasks get the same card, review
# gate and red-check feedback as any factory project. `scripts/ci.sh` runs the same locally.
name: peppa-ci
on:
pull_request:
push:
branches: [main]
env:
PEPPA_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
PEPPA_BRANCH: ${{ github.head_ref || github.ref_name }}
PEPPA_PR: ${{ github.event.pull_request.number }}
PEPPA_CI_SECRET: ${{ secrets.PEPPA_CI_SECRET }}
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
ci:
# The runner has the host's docker.sock: only branches of this repository, never forks.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: peppa-trusted
timeout-minutes: 30
env:
# Peppa's data is SQLite (a temp file per test file). Postgres on the host is only the source
# for the Postgres → SQLite migration test, which makes and drops its own database.
PEPPA_TEST_PG: postgres://peppa:peppa@host.docker.internal:5433
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.PEPPA_SHA }}
- uses: actions/setup-node@v4
with:
node-version: "26"
- name: tools
run: |
apt-get update -qq && apt-get install -y -qq tmux >/dev/null
npm install -g pnpm@12.18.0 @fission-ai/openspec@2.0.0 >/dev/null
- id: install
name: install
run: bash .gitea/peppa-check.sh install
- name: typecheck
if: (success() || failure()) && steps.install.outcome == 'success'
run: bash .gitea/peppa-check.sh typecheck
- name: build
if: (success() || failure()) && steps.install.outcome == 'success'
run: bash .gitea/peppa-check.sh build
- name: test
if: (success() || failure()) && steps.install.outcome == 'success'
run: bash .gitea/peppa-check.sh test