mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
ci.yml installed the worker with --no-frozen-lockfile — left over from #397, before worker/pnpm-lock.yaml was committed in #460 — while e2e.yml and deploy-worker.yml were frozen. A Dependabot worker PR, which arrives with package.json bumped and the lockfile untouched (documented limitation), therefore passed Worker Tests against whatever resolved that morning and failed E2E with ERR_PNPM_OUTDATED_LOCKFILE. Three PRs this week (#521, #522, #523) read as a flaky E2E suite. Frozen everywhere, the stale lockfile fails the first job with its real message. dependabot.yml: ignore vitest majors in /worker. @cloudflare/vitest-pool-workers 0.22.0 peers vitest ^4.1.0 and depends on internal Vitest APIs; #522 failed on exactly that. The frontend does not use the pool and is on 5 already. Also notes the --lockfile-only + CI=true variant of the lockfile drill for worktrees without node_modules.
113 lines
3.3 KiB
YAML
113 lines
3.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# Three gates, one per thing that actually ships: the SolidJS frontend, the Cloudflare Worker,
|
|
# and lint. Those two runtimes are the whole product — browser-only mode is IndexedDB, cloud mode
|
|
# is the Worker. e2e.yml drives the built frontend against a locally-run Worker.
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '22'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Typecheck
|
|
run: pnpm run typecheck
|
|
|
|
- name: Run frontend tests
|
|
run: pnpm run test
|
|
|
|
worker:
|
|
name: Worker Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '22'
|
|
cache: 'pnpm'
|
|
|
|
# Same install as deploy-worker.yml: worker/.gitignore deliberately does not pin a
|
|
# lockfile ("deps installed fresh"), so --frozen-lockfile fails with ERR_PNPM_NO_LOCKFILE.
|
|
- name: Install worker deps (outside the pnpm workspace)
|
|
working-directory: worker
|
|
# Frozen, like e2e.yml and deploy-worker.yml. This was --no-frozen-lockfile from #397,
|
|
# before worker/pnpm-lock.yaml was committed (#460), and was never brought in line: a
|
|
# Dependabot worker PR — which arrives without a lockfile update, see dependabot.yml —
|
|
# passed here against whatever resolved that morning and failed E2E on the frozen
|
|
# install, which read as a flaky suite. Now every job installs the same pinned tree,
|
|
# and a stale lockfile fails here first, with its real error.
|
|
run: pnpm install --frozen-lockfile --ignore-workspace
|
|
|
|
- name: Typecheck
|
|
working-directory: worker
|
|
run: pnpm run typecheck
|
|
|
|
# Runs the real Worker in workerd via Miniflare, against a local D1 built from
|
|
# worker/migrations/ — so a broken migration fails here rather than at deploy time.
|
|
- name: Run worker tests
|
|
working-directory: worker
|
|
run: pnpm run test
|
|
|
|
lint:
|
|
name: Lint Frontend
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '22'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run ESLint
|
|
run: pnpm run lint
|
|
|
|
# frontend/.prettierrc is the only prettier config under frontend/. A second one
|
|
# (.prettierrc.json) once sat beside it, silently losing to .prettierrc by precedence
|
|
# while declaring a plugin that never ran -- this gate makes any such drift fail loudly.
|
|
- name: Check formatting
|
|
run: pnpm run format:check
|