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

next
yml 342 lines 12.1 KB
Raw
1 name: E2E Test Typescript SDK
2
3 on:
4 push:
5 branches: [master, next, main]
6 paths:
7 - 'ts/**'
8 # A catalog pin or lockfile change swaps what every ts/** package
9 # resolves without touching one of their files -- @composio/client
10 # 0.1.0-alpha.76 -> 2.0.0-rc.5 skipped this suite entirely that way.
11 - 'pnpm-workspace.yaml'
12 - 'pnpm-lock.yaml'
13 - 'patches/**'
14 - '.github/actions/setup-node-pnpm-bun/action.yml'
15 - '.github/actions/build-e2e-image/action.yml'
16 - '.github/workflows/ts.test-e2e.yml'
17 - 'mise.toml'
18 - 'mise.lock'
19 - 'toolchain-versions.json'
20 pull_request:
21 paths:
22 - 'ts/**'
23 # A catalog pin or lockfile change swaps what every ts/** package
24 # resolves without touching one of their files -- @composio/client
25 # 0.1.0-alpha.76 -> 2.0.0-rc.5 skipped this suite entirely that way.
26 - 'pnpm-workspace.yaml'
27 - 'pnpm-lock.yaml'
28 - 'patches/**'
29 - '.github/actions/setup-node-pnpm-bun/action.yml'
30 - '.github/actions/build-e2e-image/action.yml'
31 - '.github/workflows/ts.test-e2e.yml'
32 - 'mise.toml'
33 - 'mise.lock'
34 - 'toolchain-versions.json'
35 workflow_dispatch:
36
37 concurrency:
38 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
39 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
40
41 permissions:
42 contents: read
43
44 # Print Turborepo telemetry events to the logs instead of sending them.
45 env:
46 TURBO_TELEMETRY_DEBUG: 1
47
48 jobs:
49 toolchain-versions:
50 name: Read toolchain test matrix
51 runs-on: ubuntu-24.04
52 permissions: read-all
53 outputs:
54 node: ${{ steps.versions.outputs.node }}
55 node-digests: ${{ steps.versions.outputs.node-digests }}
56 steps:
57 - name: Checkout Code
58 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
59
60 - name: Read versions
61 id: versions
62 run: |
63 echo "node=$(jq -c '.node' toolchain-versions.json)" >> "$GITHUB_OUTPUT"
64 echo "node-digests=$(jq -c .nodeDigests toolchain-versions.json)" >> "$GITHUB_OUTPUT"
65
66 # Node.js E2E tests, running in Docker to isolate environment
67 # Each test suite defines its own versions.node in e2e.test.ts
68 # Tests that don't support the matrix version are automatically skipped
69 test-e2e-node-docker:
70 name: E2E Test Node.js ${{ matrix.node-version }}
71 needs: toolchain-versions
72 runs-on: ubuntu-24.04
73 permissions: read-all
74 strategy:
75 fail-fast: false
76 matrix:
77 node-version: ${{ fromJSON(needs.toolchain-versions.outputs.node) }}
78 env:
79 CI: 1
80 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
81 COMPOSIO_BASE_URL: ${{ secrets.COMPOSIO_BASE_URL_STAGING }}
82 COMPOSIO_USER_API_KEY: ${{ secrets.COMPOSIO_USER_API_KEY }}
83 COMPOSIO_E2E_NODE_VERSION: ${{ matrix.node-version }}
84 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
85 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
86
87 steps:
88 - name: Checkout Code
89 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
90
91 - name: Normalize Composio API keys
92 run: |
93 {
94 echo "COMPOSIO_USER_API_KEY=${COMPOSIO_USER_API_KEY}"
95 echo "COMPOSIO_API_KEY=${COMPOSIO_API_KEY}"
96 echo "COMPOSIO_BASE_URL=${COMPOSIO_BASE_URL}"
97 } >> "$GITHUB_ENV"
98
99 - name: Setup Node.js, pnpm, Bun
100 id: setup-toolchain
101 uses: ./.github/actions/setup-node-pnpm-bun
102 with:
103 enable-turbo-cache: 'true'
104
105 - name: Install Dependencies
106 run: pnpm install --frozen-lockfile
107
108 - name: Build
109 run: pnpm run build:packages
110
111 - name: Check API keys
112 id: api-keys
113 env:
114 IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
115 run: |
116 missing=()
117 for name in COMPOSIO_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY; do
118 if [ -z "${!name}" ]; then
119 missing+=("$name")
120 fi
121 done
122
123 if [ "${#missing[@]}" -gt 0 ]; then
124 echo "available=false" >> "$GITHUB_OUTPUT"
125 if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
126 echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
127 exit 0
128 fi
129
130 printf '::error::%s is not set\n' "${missing[@]}"
131 exit 1
132 fi
133
134 echo "available=true" >> "$GITHUB_OUTPUT"
135 echo "✅ API keys are configured"
136
137 - name: Pre-build Docker image for e2e tests
138 if: steps.api-keys.outputs.available == 'true'
139 uses: ./.github/actions/build-e2e-image
140 with:
141 dockerfile: ts/e2e-tests/_utils/Dockerfile.node
142 tag: composio-e2e-node:${{ matrix.node-version }}
143 cache-scope: e2e-node-${{ matrix.node-version }}
144 cache-target: toolchain
145 build-args: |
146 NODE_VERSION=${{ matrix.node-version }}
147 NODE_VERSION_DIGEST=${{ fromJSON(needs.toolchain-versions.outputs.node-digests)[matrix.node-version] }}
148 labels: |
149 composio.e2e=true
150 composio.runtime=node
151 composio.node_version=${{ matrix.node-version }}
152
153 - name: Run Node.js E2E Tests
154 if: steps.api-keys.outputs.available == 'true'
155 run: pnpm run test:e2e:node
156
157 # CLI E2E tests, running in scratch Docker to isolate environment
158 test-e2e-cli-docker:
159 name: E2E Test CLI (scratch)
160 needs: toolchain-versions
161 runs-on: ubuntu-24.04
162 permissions: read-all
163 env:
164 CI: 1
165 COMPOSIO_USER_API_KEY: ${{ secrets.COMPOSIO_USER_API_KEY }}
166 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
167 COMPOSIO_BASE_URL: ${{ secrets.COMPOSIO_BASE_URL_STAGING }}
168 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
169
170 steps:
171 - name: Checkout Code
172 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
173
174 - name: Normalize Composio API keys
175 run: |
176 {
177 echo "COMPOSIO_USER_API_KEY=${COMPOSIO_USER_API_KEY}"
178 echo "COMPOSIO_API_KEY=${COMPOSIO_API_KEY}"
179 echo "COMPOSIO_BASE_URL=${COMPOSIO_BASE_URL}"
180 } >> "$GITHUB_ENV"
181
182 - name: Setup Node.js, pnpm, Bun
183 id: setup-toolchain
184 uses: ./.github/actions/setup-node-pnpm-bun
185 with:
186 enable-turbo-cache: 'true'
187
188 - name: Install Dependencies
189 run: pnpm install --frozen-lockfile
190
191 - name: Build
192 run: pnpm run build:packages
193
194 - name: Verify CLI image reuse policy
195 run: pnpm --filter @e2e-tests/utils test
196
197 - name: Read CLI version
198 id: cli-version
199 run: |
200 CLI_VERSION=$(node -p "require('./ts/packages/cli/package.json').version")
201 echo "COMPOSIO_E2E_CLI_VERSION=${CLI_VERSION}" >> "$GITHUB_ENV"
202 echo "value=${CLI_VERSION}" >> "$GITHUB_OUTPUT"
203
204 - name: Pre-build Docker image for CLI e2e tests
205 uses: ./.github/actions/build-e2e-image
206 with:
207 dockerfile: ts/e2e-tests/_utils/Dockerfile.cli
208 tag: composio-e2e-cli:${{ steps.cli-version.outputs.value }}
209 cache-scope: e2e-cli
210 cache-target: toolchain
211 # The CLI node version comes from mise.lock and must stay present in
212 # both `node` and `nodeDigests` of toolchain-versions.json, or the
213 # digest lookup yields an empty pin.
214 build-args: |
215 CLI_VERSION=${{ steps.cli-version.outputs.value }}
216 NODE_VERSION=${{ steps.setup-toolchain.outputs.node-version }}
217 NODE_VERSION_DIGEST=${{ fromJSON(needs.toolchain-versions.outputs.node-digests)[steps.setup-toolchain.outputs.node-version] }}
218 labels: |
219 composio.e2e=true
220 composio.runtime=cli
221 composio.cli_version=${{ steps.cli-version.outputs.value }}
222 org.opencontainers.image.revision=${{ github.sha }}
223
224 # These suites run the CLI against a fake Composio deployment and replayed
225 # model turns, so they need no key and run on every PR, fork and
226 # Dependabot PRs included. The keys are blanked to keep it that way.
227 - name: Run CLI E2E Tests (no API keys)
228 env:
229 COMPOSIO_USER_API_KEY: ''
230 COMPOSIO_API_KEY: ''
231 COMPOSIO_BASE_URL: ''
232 OPENAI_API_KEY: ''
233 run: >-
234 pnpm exec turbo test:e2e:cli
235 --filter=@e2e-tests/cli-fake-backend
236 --filter=@e2e-tests/cli-operations
237 --filter=@e2e-tests/cli-agent-journeys
238
239 # After the keyless step, so a missing key cannot keep those suites from running.
240 - name: Check API keys
241 id: api-keys
242 env:
243 IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
244 run: |
245 missing=()
246 for name in COMPOSIO_API_KEY OPENAI_API_KEY COMPOSIO_USER_API_KEY; do
247 if [ -z "${!name}" ]; then
248 missing+=("$name")
249 fi
250 done
251
252 if [ "${#missing[@]}" -gt 0 ]; then
253 echo "available=false" >> "$GITHUB_OUTPUT"
254 if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
255 echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
256 exit 0
257 fi
258
259 printf '::error::%s is not set\n' "${missing[@]}"
260 exit 1
261 fi
262
263 echo "available=true" >> "$GITHUB_OUTPUT"
264 echo "✅ API keys are configured"
265
266 - name: Run CLI E2E Tests (staging)
267 if: steps.api-keys.outputs.available == 'true'
268 run: >-
269 pnpm exec turbo test:e2e:cli
270 --filter='@e2e-tests/cli-*'
271 --filter='!@e2e-tests/cli-fake-backend'
272 --filter='!@e2e-tests/cli-operations'
273 --filter='!@e2e-tests/cli-agent-journeys'
274
275 # Cloudflare Workerd E2E tests
276 test-e2e-cloudflare:
277 name: E2E Test Cloudflare Workerd
278 runs-on: ubuntu-24.04
279 permissions: read-all
280 env:
281 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
282 COMPOSIO_BASE_URL: ${{ secrets.COMPOSIO_BASE_URL_STAGING }}
283 COMPOSIO_USER_API_KEY: ${{ secrets.COMPOSIO_USER_API_KEY }}
284 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
285
286 steps:
287 - name: Checkout Code
288 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
289
290 - name: Normalize Composio API keys
291 run: |
292 {
293 echo "COMPOSIO_USER_API_KEY=${COMPOSIO_USER_API_KEY}"
294 echo "COMPOSIO_API_KEY=${COMPOSIO_API_KEY}"
295 echo "COMPOSIO_BASE_URL=${COMPOSIO_BASE_URL}"
296 } >> "$GITHUB_ENV"
297
298 - name: Setup Node.js, pnpm, Bun
299 uses: ./.github/actions/setup-node-pnpm-bun
300 with:
301 enable-turbo-cache: 'true'
302
303 - name: Install Dependencies
304 run: pnpm install --frozen-lockfile
305
306 - name: Build
307 run: pnpm run build:packages
308
309 - name: Check API keys
310 id: api-keys
311 env:
312 IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
313 run: |
314 missing=()
315 for name in COMPOSIO_API_KEY OPENAI_API_KEY; do
316 if [ -z "${!name}" ]; then
317 missing+=("$name")
318 fi
319 done
320
321 if [ "${#missing[@]}" -gt 0 ]; then
322 echo "available=false" >> "$GITHUB_OUTPUT"
323 if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
324 echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
325 exit 0
326 fi
327
328 printf '::error::%s is not set\n' "${missing[@]}"
329 exit 1
330 fi
331
332 echo "available=true" >> "$GITHUB_OUTPUT"
333 echo "✅ API keys are configured"
334
335 - name: Run Cloudflare Workers E2E Tests
336 if: steps.api-keys.outputs.available == 'true'
337 run: pnpm run test:e2e:cloudflare
338 env:
339 COMPOSIO_USER_API_KEY: ${{ secrets.COMPOSIO_USER_API_KEY }}
340 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
341 COMPOSIO_BASE_URL: ${{ secrets.COMPOSIO_BASE_URL_STAGING }}
342 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}