@devries-cameron20 / composio Mirror · read-only / commits / 8d5823be8
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 19:45 UTC

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).

Alberto Schiabel committed Jul 3, 2026 at 22:22 UTC 8d5823be87fa931fccd6f9fb0dfa04ad5756e92a
16 files changed +143 -9
.github/actions/setup-node-pnpm-bun/action.yml
+15
@@ -14,6 +14,10 @@ inputs:
14 description: 'Enable pnpm/tool cache'
15 required: false
16 default: 'true'
17 + enable-turbo-cache:
18 + description: 'Cache .turbo build outputs'
19 + required: false
20 + default: 'false'
21
22 outputs:
23 node-version:
@@ -93,6 +97,17 @@ runs:
97 restore-keys: |
98 ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-
99
100 + - name: Cache turbo build outputs
101 + if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true'
102 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
103 + with:
104 + path: .turbo/cache
105 + # Keyed per job: concurrent jobs save different task graphs under the
106 + # same commit, and actions/cache is first-writer-wins on exact keys.
107 + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
108 + restore-keys: |
109 + ${{ runner.os }}-turbo-${{ github.job }}-
110 +
111 - name: Report versions
112 id: versions
113 shell: bash
.github/workflows/docs-check-links.yml
+12
@@ -9,6 +9,10 @@ on:
9 - 'mise.toml'
10 - 'mise.lock'
11
12 +concurrency:
13 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
14 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15 +
16 jobs:
17 check-links:
18 runs-on: ubuntu-latest
@@ -23,6 +27,14 @@ jobs:
27 - name: Setup Node.js, pnpm, Bun
28 uses: ./.github/actions/setup-node-pnpm-bun
29
30 + - name: Cache bun dependencies
31 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
32 + with:
33 + path: ~/.bun/install/cache
34 + key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
35 + restore-keys: |
36 + ${{ runner.os }}-bun-
37 +
38 - name: Install dependencies
39 run: bun install
40
.github/workflows/docs-search-sync.yml
+8
@@ -38,6 +38,14 @@ jobs:
38 - name: Setup Node.js, pnpm, Bun
39 uses: ./.github/actions/setup-node-pnpm-bun
40
41 + - name: Cache bun dependencies
42 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
43 + with:
44 + path: ~/.bun/install/cache
45 + key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
46 + restore-keys: |
47 + ${{ runner.os }}-bun-
48 +
49 - name: Install dependencies
50 run: bun install
51
.github/workflows/docs-tests.yml
+12
@@ -9,6 +9,10 @@ on:
9 - 'mise.toml'
10 - 'mise.lock'
11
12 +concurrency:
13 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
14 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15 +
16 jobs:
17 test:
18 runs-on: ubuntu-latest
@@ -23,6 +27,14 @@ jobs:
27 - name: Setup Node.js, pnpm, Bun
28 uses: ./.github/actions/setup-node-pnpm-bun
29
30 + - name: Cache bun dependencies
31 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
32 + with:
33 + path: ~/.bun/install/cache
34 + key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
35 + restore-keys: |
36 + ${{ runner.os }}-bun-
37 +
38 - name: Install dependencies
39 run: bun install
40
.github/workflows/docs-typescript-check.yml
+12
@@ -9,6 +9,10 @@ on:
9 - 'mise.toml'
10 - 'mise.lock'
11
12 +concurrency:
13 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
14 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15 +
16 jobs:
17 typescript-check:
18 runs-on: ubuntu-latest
@@ -23,6 +27,14 @@ jobs:
27 - name: Setup Node.js, pnpm, Bun
28 uses: ./.github/actions/setup-node-pnpm-bun
29
30 + - name: Cache bun dependencies
31 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
32 + with:
33 + path: ~/.bun/install/cache
34 + key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
35 + restore-keys: |
36 + ${{ runner.os }}-bun-
37 +
38 - name: Install dependencies
39 run: bun install
40
.github/workflows/docs-update-data.yml
+8
@@ -77,6 +77,14 @@ jobs:
77
78 echo "Configured staging API endpoints"
79
80 + - name: Cache bun dependencies
81 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
82 + with:
83 + path: ~/.bun/install/cache
84 + key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
85 + restore-keys: |
86 + ${{ runner.os }}-bun-
87 +
88 - name: Install dependencies
89 run: bun install
90
.github/workflows/py.check.yaml
+4
@@ -18,6 +18,10 @@ on:
18 - 'mise.toml'
19 - 'mise.lock'
20
21 +concurrency:
22 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
23 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24 +
25 jobs:
26 common-checks:
27 runs-on: ubuntu-latest
.github/workflows/py.test.yml
+8 -4
@@ -24,6 +24,10 @@ on:
24 - 'python/pyproject.toml'
25 - 'python/requirements*.txt'
26
27 +concurrency:
28 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
29 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
30 +
31 jobs:
32 toolchain-versions:
33 name: Read toolchain test matrix
@@ -55,13 +59,13 @@ jobs:
59 with:
60 python-version: ${{ matrix.python-version }}
61
58 - - name: Cache pip dependencies
62 + - name: Cache uv dependencies
63 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
64 with:
61 - path: ~/.cache/pip
62 - key: pip-${{ matrix.python-version }}-${{ hashFiles('python/pyproject.toml') }}
65 + path: ~/.cache/uv
66 + key: uv-${{ matrix.python-version }}-${{ hashFiles('python/pyproject.toml', 'mise.toml') }}
67 restore-keys: |
64 - pip-${{ matrix.python-version }}-
68 + uv-${{ matrix.python-version }}-
69
70 - name: Install UV
71 run: |
.github/workflows/ts.audit.yml
+4
@@ -18,6 +18,10 @@ on:
18 - 'mise.toml'
19 - 'mise.lock'
20
21 +concurrency:
22 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
23 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24 +
25 jobs:
26 audit:
27 name: Audit
.github/workflows/ts.build.yml
+8
@@ -9,6 +9,7 @@ on:
9 - '.github/workflows/ts.build.yml'
10 - 'mise.toml'
11 - 'mise.lock'
12 + - 'turbo.jsonc'
13 - 'package.json'
14 - 'pnpm-lock.yaml'
15 - 'pnpm-workspace.yaml'
@@ -20,11 +21,16 @@ on:
21 - '.github/workflows/ts.build.yml'
22 - 'mise.toml'
23 - 'mise.lock'
24 + - 'turbo.jsonc'
25 - 'package.json'
26 - 'pnpm-lock.yaml'
27 - 'pnpm-workspace.yaml'
28 - 'tsdown.config.base.ts'
29
30 +concurrency:
31 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
32 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
33 +
34 # Print Turborepo telemetry events to the logs instead of sending them.
35 env:
36 TURBO_TELEMETRY_DEBUG: 1
@@ -40,6 +46,8 @@ jobs:
46
47 - name: Setup Node.js, pnpm, Bun
48 uses: ./.github/actions/setup-node-pnpm-bun
49 + with:
50 + enable-turbo-cache: 'true'
51
52 - name: Install Dependencies
53 run: pnpm install --frozen-lockfile
.github/workflows/ts.test-e2e.yml
+11
@@ -20,6 +20,10 @@ on:
20 - 'toolchain-versions.json'
21 workflow_dispatch:
22
23 +concurrency:
24 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
25 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26 +
27 # Print Turborepo telemetry events to the logs instead of sending them.
28 env:
29 TURBO_TELEMETRY_DEBUG: 1
@@ -78,6 +82,8 @@ jobs:
82 - name: Setup Node.js, pnpm, Bun
83 id: setup-toolchain
84 uses: ./.github/actions/setup-node-pnpm-bun
85 + with:
86 + enable-turbo-cache: 'true'
87
88 - name: Install Dependencies
89 run: pnpm install --frozen-lockfile
@@ -164,6 +170,8 @@ jobs:
170 - name: Setup Node.js, pnpm, Bun
171 id: setup-toolchain
172 uses: ./.github/actions/setup-node-pnpm-bun
173 + with:
174 + enable-turbo-cache: 'true'
175
176 - name: Install Dependencies
177 run: pnpm install --frozen-lockfile
@@ -201,6 +209,8 @@ jobs:
209 - name: Setup Node.js, pnpm, Bun
210 id: setup-toolchain
211 uses: ./.github/actions/setup-node-pnpm-bun
212 + with:
213 + enable-turbo-cache: 'true'
214
215 - name: Install Dependencies
216 run: pnpm install --frozen-lockfile
@@ -250,6 +260,7 @@ jobs:
260 - name: Setup Node.js, pnpm, Bun
261 uses: ./.github/actions/setup-node-pnpm-bun
262 with:
263 + enable-turbo-cache: 'true'
264 node-version: '22.22.3'
265
266 - name: Install Dependencies
.github/workflows/ts.test.yml
+8
@@ -9,6 +9,7 @@ on:
9 - '.github/workflows/ts.test.yml'
10 - 'mise.toml'
11 - 'mise.lock'
12 + - 'turbo.jsonc'
13 pull_request:
14 branches: [master, next]
15 paths:
@@ -17,6 +18,11 @@ on:
18 - '.github/workflows/ts.test.yml'
19 - 'mise.toml'
20 - 'mise.lock'
21 + - 'turbo.jsonc'
22 +
23 +concurrency:
24 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
25 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26
27 jobs:
28 test:
@@ -31,6 +37,8 @@ jobs:
37
38 - name: Setup Node.js, pnpm, Bun
39 uses: ./.github/actions/setup-node-pnpm-bun
40 + with:
41 + enable-turbo-cache: 'true'
42
43 - name: Install Dependencies
44 run: pnpm install --frozen-lockfile
.github/workflows/ts.typecheck.yml
+8
@@ -9,6 +9,7 @@ on:
9 - '.github/workflows/ts.typecheck.yml'
10 - 'mise.toml'
11 - 'mise.lock'
12 + - 'turbo.jsonc'
13 pull_request:
14 branches: [master, next]
15 paths:
@@ -17,6 +18,11 @@ on:
18 - '.github/workflows/ts.typecheck.yml'
19 - 'mise.toml'
20 - 'mise.lock'
21 + - 'turbo.jsonc'
22 +
23 +concurrency:
24 + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
25 + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26
27 jobs:
28 typecheck:
@@ -29,6 +35,8 @@ jobs:
35
36 - name: Setup Node.js, pnpm, Bun
37 uses: ./.github/actions/setup-node-pnpm-bun
38 + with:
39 + enable-turbo-cache: 'true'
40
41 - name: Install Dependencies
42 run: pnpm install --frozen-lockfile
pnpm-lock.yaml
+4
@@ -1607,6 +1607,10 @@ importers:
1607 zod-to-json-schema:
1608 specifier: 'catalog:'
1609 version: 3.25.2(zod@4.4.3)
1610 + devDependencies:
1611 + '@composio/core':
1612 + specifier: workspace:*
1613 + version: link:../core
1614
1615 ts/packages/ts-builders:
1616 dependencies:
ts/packages/slim/package.json
+4 -1
@@ -78,7 +78,7 @@
78 ],
79 "scripts": {
80 "clean": "git clean -xdf dist generated node_modules",
81 - "build": "pnpm --filter @composio/core build && rm -rf dist generated && cp -R ../core/dist ./dist && rm -rf dist/docs && if [ -d ../core/generated ]; then cp -R ../core/generated ./generated; fi",
81 + "build": "rm -rf dist generated && cp -R ../core/dist ./dist && rm -rf dist/docs && if [ -d ../core/generated ]; then cp -R ../core/generated ./generated; fi",
82 "test": "node -e \"import('./dist/index.mjs').then(() => console.log('@composio/slim import ok'))\""
83 },
84 "keywords": [
@@ -94,6 +94,9 @@
94 "peerDependencies": {
95 "zod": "^3.25 || ^4"
96 },
97 + "devDependencies": {
98 + "@composio/core": "workspace:*"
99 + },
100 "dependencies": {
101 "@composio/client": "catalog:",
102 "@composio/json-schema-to-zod": "workspace:*",
turbo.jsonc
+17 -4
@@ -5,6 +5,10 @@
5 // mise stays the single source of truth. Turbo then infers pnpm from
6 // pnpm-lock.yaml for workspace resolution.
7 "dangerouslyDisablePackageManagerCheck": true,
8 + // The toolchain (node, bun, pnpm, tsgo host) is pinned by mise, not by
9 + // package.json/lockfile, so toolchain bumps must invalidate every task hash
10 + // or restored CI caches would skip the very runs meant to validate them.
11 + "globalDependencies": ["mise.toml", "mise.lock"],
12 "tasks": {
13 "build": {
14 "dependsOn": ["^build"],
@@ -13,14 +17,15 @@
17 "tsdown.config.ts",
18 // for core
19 "../../../tsdown.config.base.ts",
20 + "../../../tsconfig.base.json",
21 // for providers
17 - "../../../../tsdown.config.base.ts"
22 + "../../../../tsdown.config.base.ts",
23 + "../../../../tsconfig.base.json"
24 ],
25 "outputs": ["dist/"]
26 },
27 "test": {
22 - "dependsOn": ["^build"],
23 - "outputs": ["dist/"]
28 + "dependsOn": ["^build"]
29 },
30 "test:e2e": {
31 "dependsOn": ["^build"],
@@ -56,7 +61,15 @@
61 },
62 "typecheck": {
63 "dependsOn": ["^build"],
59 - "cache": false
64 + // package tsconfigs extend the root base config, which lives outside the
65 + // package dirs and is therefore not part of $TURBO_DEFAULT$
66 + "inputs": [
67 + "$TURBO_DEFAULT$",
68 + // for core
69 + "../../../tsconfig.base.json",
70 + // for providers
71 + "../../../../tsconfig.base.json"
72 + ]
73 },
74 "typecheck:tsc": {
75 "dependsOn": ["^build"],