Each step was re-running pnpm install independently, and all quality steps (typecheck, lint, format, test) ran in parallel. On merge commits with more accumulated code this pushed the CI runner over its memory limit (exit code 254 = OOM kill). Fix: - install once, share node_modules via Woodpecker workspace volume - sequential execution: install → typecheck → lint → format → test → build - corepack enable in each step (fresh container) but no redundant install
58 lines
1.0 KiB
YAML
58 lines
1.0 KiB
YAML
variables:
|
|
- &node_image 'node:22-alpine'
|
|
- &enable_pnpm 'corepack enable'
|
|
|
|
when:
|
|
- event: [push, pull_request, manual]
|
|
|
|
# Steps run sequentially to avoid OOM on the CI runner.
|
|
# node_modules is installed once by the install step and shared across
|
|
# all subsequent steps via Woodpecker's shared workspace volume.
|
|
|
|
steps:
|
|
install:
|
|
image: *node_image
|
|
commands:
|
|
- corepack enable
|
|
- pnpm install --frozen-lockfile
|
|
|
|
typecheck:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm typecheck
|
|
depends_on:
|
|
- install
|
|
|
|
lint:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm lint
|
|
depends_on:
|
|
- typecheck
|
|
|
|
format:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm format:check
|
|
depends_on:
|
|
- lint
|
|
|
|
test:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm test
|
|
depends_on:
|
|
- format
|
|
|
|
build:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm build
|
|
depends_on:
|
|
- test
|