- Connect to turbo.mosaicstack.dev remote cache (ducktors/turborepo-remote-cache)
- Parallelize lint, format, and test after typecheck (were sequential)
- Add turbo_token secret for cache authentication
- TURBO_API + TURBO_TEAM env vars on all Turbo-managed steps
Before: install → typecheck → lint → format → test → build (serial)
After: install → typecheck → lint ─┐
format ├→ build
test ──┘
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
77 lines
1.6 KiB
YAML
77 lines
1.6 KiB
YAML
variables:
|
|
- &node_image 'node:22-alpine'
|
|
- &enable_pnpm 'corepack enable'
|
|
|
|
when:
|
|
- event: [push, pull_request, manual]
|
|
|
|
# Turbo remote cache is at turbo.mosaicstack.dev (ducktors/turborepo-remote-cache).
|
|
# TURBO_TOKEN is set as a Woodpecker secret. Turbo picks up TURBO_API, TURBO_TOKEN,
|
|
# and TURBO_TEAM from the environment automatically.
|
|
|
|
steps:
|
|
install:
|
|
image: *node_image
|
|
commands:
|
|
- corepack enable
|
|
- pnpm install --frozen-lockfile
|
|
|
|
typecheck:
|
|
image: *node_image
|
|
environment:
|
|
TURBO_API: https://turbo.mosaicstack.dev
|
|
TURBO_TEAM: mosaic
|
|
secrets: [turbo_token]
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm typecheck
|
|
depends_on:
|
|
- install
|
|
|
|
# lint, format, and test are independent — run in parallel after typecheck
|
|
lint:
|
|
image: *node_image
|
|
environment:
|
|
TURBO_API: https://turbo.mosaicstack.dev
|
|
TURBO_TEAM: mosaic
|
|
secrets: [turbo_token]
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm lint
|
|
depends_on:
|
|
- typecheck
|
|
|
|
format:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm format:check
|
|
depends_on:
|
|
- typecheck
|
|
|
|
test:
|
|
image: *node_image
|
|
environment:
|
|
TURBO_API: https://turbo.mosaicstack.dev
|
|
TURBO_TEAM: mosaic
|
|
secrets: [turbo_token]
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm test
|
|
depends_on:
|
|
- typecheck
|
|
|
|
build:
|
|
image: *node_image
|
|
environment:
|
|
TURBO_API: https://turbo.mosaicstack.dev
|
|
TURBO_TEAM: mosaic
|
|
secrets: [turbo_token]
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm build
|
|
depends_on:
|
|
- lint
|
|
- format
|
|
- test
|