Files
CatoandClaude Opus 5.5 5bcb27cd00 chore(ci): one check per change — remove the merge sweep, check on PRs only (#110)
Removes the fleet auto-merge sweep caller (and wake chain where present);
checks run on pull requests only, not again after merging; a deploy that
waited for CI on main now deploys on push. The forge merge check
(forge/verify) verifies each PR on its merge result and merges it.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:14:20 +01:00

93 lines
3.6 KiB
YAML

# CI floor — modelled on bitbaum/fleet templates/ci/ci-npm.yml.
#
# NB: the deployed application is `app/`, NOT the repo root. The fleet deploy
# registry (loki/scripts/hetzner/apps.conf) pins
# printcraft|4015|printcraft.orangecat.ch|/home/g/dev/printcraft|app|-
# i.e. APP_DIR=app, so deploy.sh builds in `app/` and ships `app/.next/standalone`.
# The root-level Next tree (root `src/`, `next.config.ts`, `package.json`, …) is a
# stale March-2026 duplicate that nothing builds. CI gates the tree that ships.
name: CI
on:
pull_request:
branches: [main]
workflow_dispatch:
# A newer push makes the older run obsolete — don't waste minutes finishing it.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: app
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
# pnpm before setup-node so `cache: pnpm` can find the store.
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
# .nvmrc = the version deploy.sh actually builds the standalone bundle on.
node-version-file: .nvmrc
cache: pnpm
cache-dependency-path: |
pnpm-lock.yaml
app/pnpm-lock.yaml
- uses: actions/setup-python@v7
with:
# pyproject declares requires-python >=3.11; pin the floor so a
# newer default runner image cannot quietly change what CI tests on.
python-version: '3.11'
- name: Install
run: pnpm install --frozen-lockfile
# The root holds only prettier, for the root `format:check`.
- name: Install (root)
working-directory: .
run: pnpm install --frozen-lockfile
# SSOT: "verified" is defined ONCE, in the root package.json `verify`
# (= root format:check + app/package.json `verify`, which is lint +
# typecheck + test), and run identically here and locally via
# `pnpm run verify` at the root. CI used to run only the app's verify, so
# the root format:check broke on main (app/pnpm-workspace.yaml) and
# nothing noticed. Change the checks in one place.
- name: Verify
working-directory: .
run: pnpm run verify
# The Python pipeline is the other half of this repo and the one that
# produces the client deliverable, so it gets gated too. It had no tests
# and no CI at all until a partly-failed generation round was found
# exiting 0. Deliberately NOT folded into `pnpm run verify`: that gate has
# to work from a bare `pnpm install`, and these need a Python env.
- name: Python pipeline tests
working-directory: .
run: |
python -m pip install --quiet -e '.[dev]'
python -m pytest -q
- name: Build
# Hermetic compile. NEXT_PUBLIC_* are baked at build time and the static
# pages construct a Supabase browser client, which throws on missing
# vars — these are fake, non-secret placeholders. No DB is contacted.
env:
NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder-anon-key
SUPABASE_SERVICE_ROLE_KEY: placeholder-service-role-key
run: pnpm run build
- name: Deploy contract — standalone output exists
# deploy.sh aborts with "no standalone output" if next.config.ts ever
# loses `output: "standalone"`. Catch that here, not at deploy time.
run: test -f "$(find .next/standalone -maxdepth 4 -name server.js -not -path '*node_modules*' | head -1)"