CICD-384 · Turborepo remote caching
Encyclopedia · Monorepo and large-scale build engineering · All snippets
Previous · CICD-383 · Next · CICD-385
1. Where it fits
- Placement CI run step or authorized lab terminal.
- Prerequisites trusted checkout with the base ref fetched and pinned package manager or build tool.
- Platforms local-linux, github-actions, gitea-actions.
- Parameters
TURBO_TEAM,TURBO_TOKEN.
2. Copy the snippet
bash
test -n "${TURBO_TOKEN:?}" && test -n "${TURBO_TEAM:?}"
pnpm exec turbo run build --cache=local:rw,remote:rw3. How it works
The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.
4. Verify the result
Enable cache writes only for trusted branches. Change an input and verify a cache miss.
Watch for. Use the intended trusted execution context. Keep secret values out of traces, artifacts and debug output.
Validation syntax-validated (Bash parse). Status definitions.