6467e89991
This repo had no CI, no branch protection and no reviewer. Add the gate.
.gitea/workflows/ci.yml runs two independent contexts on every PR and on
push to main:
build npm ci -> next build -> tsc --noEmit -> node:test
`next build` has to run BEFORE `tsc --noEmit`: the content-collections
Next plugin is what emits .content-collections/generated (the
`content-collections` module alias) and .next/types. Typechecking a
cold tree reports ~20 phantom TS2307/TS7006 errors that say nothing
about the code.
lint npm ci -> eslint
Lint decision: `npm run lint` was `next lint`, which (a) is deprecated in
Next 15.5 and removed in 16 and (b) was never configured here — no ESLint
config, no ESLint dependency — so it silently checked nothing. Rather than
lean on the build's own lint step (which, unconfigured, is also a no-op),
ESLint is now configured properly: eslint.config.mjs extends
next/core-web-vitals + next/typescript through FlatCompat, the layout
create-next-app@15 emits, and `npm run lint` runs `eslint .`.
Turning it on found 8 real errors, all @next/next/no-html-link-for-pages in
SiteFooter: the Platform-variant footer navigates home with plain <a>, so
every footer link out of /pricing was a full document reload. Those anchors
now use next/link. They render the same DOM with the same hrefs and
classNames — the emitted CSS is byte-identical (2b768740753229e4.css /
bb4644fbaa9e8a3b.css unchanged across the build) — they just soft-navigate.
The 18 remaining findings are @next/next/no-img-element warnings and stay
warnings: this site is a deliberate 1:1 DOM port of a static design and uses
plain <img> throughout. Errors fail the job, warnings are reported.
Verified locally: npm ci, next build (62 static pages), tsc --noEmit clean,
7/7 tests, eslint 0 errors / 18 warnings.
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
# Enter OS landing site — CI gate.
|
|
#
|
|
# Everything a Next.js static-ish marketing site can be wrong about, checked
|
|
# before merge. Two independent contexts so a red one names its own failure:
|
|
#
|
|
# build npm ci -> next build -> tsc --noEmit -> node:test
|
|
# `next build` runs FIRST because the content-collections Next plugin
|
|
# is what emits .content-collections/generated (the `content-collections`
|
|
# module alias) and .next/types — without it `tsc --noEmit` reports
|
|
# ~20 phantom TS2307/TS7006 errors. Build, then typecheck.
|
|
# lint npm ci -> eslint
|
|
# `next lint` is deprecated in Next 15.5 and removed in 16, and was
|
|
# never configured in this repo (no eslint config, no eslint dep), so
|
|
# it silently did nothing. ESLint now runs directly off
|
|
# eslint.config.mjs (next/core-web-vitals + next/typescript).
|
|
# Errors fail the job; the repo's pre-existing `no-img-element`
|
|
# findings stay warnings (this is a verbatim DOM port of a static
|
|
# design that intentionally uses plain <img>).
|
|
#
|
|
# Branch protection on main requires every context here to be green.
|
|
|
|
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
|
|
jobs:
|
|
build:
|
|
name: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
# Matches the Dockerfile's node:22-bookworm-slim build stage.
|
|
node-version: "22"
|
|
cache: npm
|
|
|
|
- name: Install from lockfile
|
|
run: npm ci
|
|
|
|
- name: Build (emits content-collections bindings + .next/types)
|
|
run: npm run build
|
|
|
|
- name: Typecheck
|
|
run: npx tsc --noEmit
|
|
|
|
- name: Tests
|
|
run: npm test
|
|
|
|
lint:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
|
|
- name: Install from lockfile
|
|
run: npm ci
|
|
|
|
- name: ESLint
|
|
run: npm run lint
|