mirror of
https://github.com/bitbaum/petvity.git
synced 2026-12-04 08:47:26 +01:00
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch, LOKI_* env keys, loki-* units. This repo referenced the old name in 9 files changed, 15 insertions(+), 15 deletions(-). Email addresses at the old sending domain stay until the new domain is verified in Resend. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
76 lines
2.9 KiB
YAML
76 lines
2.9 KiB
YAML
# Golden CI floor — see dotfiles/templates/ci/README.md.
|
|
# petvity: pnpm + vitest. 61 test files / ~541 cases that never ran on the shared
|
|
# branch until now. No `typecheck` script exists, so tsc is invoked directly.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
# On a branch the newest push is the only one that matters, so cancel the rest.
|
|
#
|
|
# On main the group is keyed per COMMIT. A commit cancelling a DIFFERENT
|
|
# commit's run breaks deployment, because every deploy path keys off that run:
|
|
# one that waits for CI to pass on the commit finds a cancelled run and stops,
|
|
# and one chained on `workflow_run` sees conclusion=cancelled and skips.
|
|
# auto-merge also re-arms CI with a dispatch, which under a single
|
|
# group-per-branch cancels the push run for the SAME commit.
|
|
#
|
|
# Measured 2026-09-11 across the fleet: 28 of 39 ci.yml files had this shape.
|
|
# loki stranded four merges silently (main green, nothing red, the box
|
|
# serving the previous build); hirnli failed its deploy loudly at the wait step.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || 'branch' }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: pnpm/action-setup@v6
|
|
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
|
|
# Next keeps its compiler output in .next/cache. Without restoring it,
|
|
# every CI run recompiles the whole app from scratch — and the deploy
|
|
# then compiles it a second time. Measured across the fleet on
|
|
# 2026-09-07: of eight repos, exactly one cached this.
|
|
#
|
|
# Keyed on the lockfile so a dependency change invalidates it. The bare
|
|
# restore-key is last on purpose: a stale cache still beats no cache,
|
|
# and Next validates its own entries rather than trusting them.
|
|
- name: Cache Next.js build
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: .next/cache
|
|
key: nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
|
|
restore-keys: |
|
|
nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
|
|
nextjs-${{ runner.os }}-
|
|
|
|
- name: Install
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
# SSOT: one definition of "verified" (lint + typecheck + test) lives in
|
|
# package.json `verify`, run identically here and locally.
|
|
- name: Verify
|
|
run: pnpm run verify
|
|
|
|
# Build is now GATED. It used to be deferred because next build prerendered
|
|
# /sitemap.xml, which queried Postgres — now the sitemap is `force-dynamic`
|
|
# (+ DB-blip-resilient), so the build is hermetic. Placeholder DB URL just
|
|
# satisfies tools that read the var without connecting.
|
|
- name: Build
|
|
env:
|
|
DATABASE_URL: postgres://ci:ci@localhost:5432/ci
|
|
run: pnpm build
|