Turbo Pipeline
Configure Turborepo tasks, caching, dependencies, and environment rules for enterprise delivery.
The pipeline is the execution contract of a monorepo. It decides which tasks run, in what order, which outputs are cached, and which environment variables affect correctness.
Task Layers
| Task | Purpose | Cache expectation |
|---|---|---|
lint | Static quality and style checks | Cacheable |
typecheck | Type contract validation | Cacheable |
test | Unit and integration tests | Cacheable when deterministic |
build | Production artifact creation | Cacheable with explicit outputs |
dev | Local development server | Not cacheable |
deploy | External side effect | Not cacheable |
Pipeline Rules
- Define dependencies between tasks, not only task names.
- List build outputs explicitly so cache restore is reliable.
- Treat environment variables as part of the cache key when they affect output.
- Keep long-running development tasks outside cached CI paths.
- Run affected workspaces where possible, but preserve full verification for release gates.
Common Pattern
| Need | Pattern |
|---|---|
| Build packages before apps | App build depends on upstream package build |
| Validate contracts early | Run typecheck before expensive tests |
| Avoid stale artifacts | Declare outputs and clean rules |
| Protect production | Add release-only gates after normal CI |
Failure Review
When a pipeline fails, ask whether the problem is code, dependency order, cache configuration, environment leakage, or a nondeterministic test. Treat repeated flaky CI as a product problem for the platform team.