Files
composiohq__composio/turbo.jsonc
T
Alberto Schiabel 8d5823be87 chore(ci): cache turbo, bun, and uv and cancel superseded pr runs (#3747)
This PR:

- adds `concurrency` to the ten PR/push CI workflows: superseded **PR**
runs are cancelled, while push runs use a per-run group
(`github.run_id`) so every commit on `next`/`master` still gets its own
run
- caches turbo outputs (`.turbo/cache`) via a new opt-in
`enable-turbo-cache` input on the `setup-node-pnpm-bun` composite (keyed
per job — concurrent jobs save different task graphs), enabled in
`ts.build`, `ts.test`, `ts.typecheck`, and all four `ts.test-e2e` jobs
- enables turbo caching for `typecheck`, removes the incorrect `dist/`
outputs from `test`, hashes root `tsconfig.base.json` in
`build`/`typecheck` inputs, and adds `mise.toml`/`mise.lock` to
`globalDependencies` so toolchain bumps bust every task hash (addresses
the Bugbot finding)
- fixes `@composio/slim`'s build to participate in the turbo graph: core
moves to slim's `devDependencies` (published `dependencies` unchanged)
and the script no longer shells out to `pnpm --filter @composio/core
build`, which raced concurrent dependents by wiping `core/dist`
mid-build and double-built core on every cold run — slim's `dist`
remains byte-identical to core's; no changeset added since the published
artifact is unchanged (say the word if policy wants one anyway)
- fixes the `py.test` matrix cache to `~/.cache/uv` (it cached
`~/.cache/pip` while installing via `uv pip`) and caches
`~/.bun/install/cache` in the five docs workflows
- adds `turbo.jsonc` to the TS workflows' path filters (previously
unwatched)
- release/publish workflows are deliberately untouched

Measured (same commit, cold first attempt vs `gh run rerun` warm):
ts.build 103s → 53s, ts.test 157s → 55s (`turbo test` 24/24 cached in
182ms), ts.typecheck 80s → 43s; py.test legs save a few seconds each (uv
was already fast). Warm floor is checkout + mise + pnpm-install
overhead.

## Context

Implements `plans/001-ci-speed-caching-and-concurrency.md` from the
advisor audit on `docs/sdk-v1-decision-records`. Implementation by codex
against the plan, then self-reviewed and counter-reviewed; warm-rerun
testing surfaced and fixed three latent issues (toolchain files absent
from turbo's hash, first-writer-wins cache-key collision across jobs,
and the slim out-of-band core rebuild race).
2026-07-03 22:22:18 +04:00

97 lines
3.0 KiB
JSON

{
"$schema": "https://turbo.build/schema.json",
// pnpm is pinned solely by mise (`npm:pnpm` in mise.toml). We intentionally
// omit the root `packageManager` field rather than duplicate that version, so
// mise stays the single source of truth. Turbo then infers pnpm from
// pnpm-lock.yaml for workspace resolution.
"dangerouslyDisablePackageManagerCheck": true,
// The toolchain (node, bun, pnpm, tsgo host) is pinned by mise, not by
// package.json/lockfile, so toolchain bumps must invalidate every task hash
// or restored CI caches would skip the very runs meant to validate them.
"globalDependencies": ["mise.toml", "mise.lock"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": [
"$TURBO_DEFAULT$",
"tsdown.config.ts",
// for core
"../../../tsdown.config.base.ts",
"../../../tsconfig.base.json",
// for providers
"../../../../tsdown.config.base.ts",
"../../../../tsconfig.base.json"
],
"outputs": ["dist/"]
},
"test": {
"dependsOn": ["^build"]
},
"test:e2e": {
"dependsOn": ["^build"],
"env": ["ANTHROPIC_API_KEY", "COMPOSIO_API_KEY", "COMPOSIO_BASE_URL", "COMPOSIO_USER_API_KEY", "OPENAI_API_KEY"],
"cache": false
},
"test:e2e:node": {
"dependsOn": ["^build"],
"env": ["ANTHROPIC_API_KEY", "COMPOSIO_API_KEY", "COMPOSIO_BASE_URL", "COMPOSIO_USER_API_KEY", "COMPOSIO_E2E_NODE_VERSION", "OPENAI_API_KEY"],
"cache": false
},
"test:e2e:deno": {
"dependsOn": ["^build"],
"env": ["COMPOSIO_API_KEY", "COMPOSIO_BASE_URL", "COMPOSIO_USER_API_KEY", "COMPOSIO_E2E_DENO_VERSION", "OPENAI_API_KEY"],
"cache": false
},
"test:e2e:cli": {
"dependsOn": ["^build"],
"env": ["COMPOSIO_API_KEY", "COMPOSIO_BASE_URL", "COMPOSIO_USER_API_KEY", "COMPOSIO_E2E_CLI_VERSION", "OPENAI_API_KEY"],
"cache": false
},
"test:e2e:cloudflare": {
"dependsOn": ["^build"],
"env": ["COMPOSIO_API_KEY", "COMPOSIO_BASE_URL", "COMPOSIO_USER_API_KEY", "OPENAI_API_KEY"],
"cache": false
},
"install:binary": {
"dependsOn": ["build:binary"],
"cache": false
},
"clean": {
"cache": false
},
"typecheck": {
"dependsOn": ["^build"],
// package tsconfigs extend the root base config, which lives outside the
// package dirs and is therefore not part of $TURBO_DEFAULT$
"inputs": [
"$TURBO_DEFAULT$",
// for core
"../../../tsconfig.base.json",
// for providers
"../../../../tsconfig.base.json"
]
},
"typecheck:tsc": {
"dependsOn": ["^build"],
"cache": false
},
"//#clean": {
"cache": false
},
"record": {
"dependsOn": ["^build"],
"inputs": [
"src/**",
"scripts/record.ts",
"recordings/recordings.yaml"
],
"outputs": [
"recordings/tapes/**",
"recordings/svgs/**",
"recordings/ascii/**"
],
"env": ["COMPOSIO_API_KEY"]
}
}
}