@devries-cameron20 / composio Mirror · read-only
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, 03:37 UTC

next
yml 253 lines 9.33 KB
Raw
1 name: CLI Install E2E
2
3 on:
4 schedule:
5 - cron: '0 7 * * *'
6 workflow_dispatch:
7 pull_request:
8 paths:
9 - 'install.sh'
10 - 'install/**'
11 - 'test/install-sh-release-resolution.test.sh'
12 - 'ts/packages/cli/**'
13 - 'ts/e2e-tests/cli/install/**'
14 - 'ts/e2e-tests/_utils/**'
15 - '.github/actions/setup-node-pnpm-bun/action.yml'
16 - '.github/actions/build-e2e-image/action.yml'
17 - '.github/workflows/cli.install-e2e.yml'
18 - 'package.json'
19 - 'pnpm-lock.yaml'
20 - 'pnpm-workspace.yaml'
21 - 'turbo.jsonc'
22 - 'mise.toml'
23 - 'mise.lock'
24
25 concurrency:
26 group: ${{ github.workflow }}-${{ github.ref }}
27 cancel-in-progress: false
28
29 permissions:
30 contents: read
31
32 jobs:
33 # The shell-variant routes (/install/bash, /install/zsh, /install/fish) are not
34 # provisioned in production yet — they 404. Until they ship, the harness's prod
35 # mode installs through the base /install route and selects the shell with
36 # COMPOSIO_INSTALL_SHELL (see ts/e2e-tests/cli/install/e2e.test.ts); restore the
37 # variant-route coverage there once the routes are live.
38 production:
39 name: Production install (${{ matrix.shell }}, ${{ matrix.version }})
40 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
41 runs-on: ubuntu-latest
42 timeout-minutes: 20
43 strategy:
44 fail-fast: false
45 matrix:
46 include:
47 - shell: bash
48 version: latest
49 - shell: zsh
50 version: latest
51 - shell: fish
52 version: latest
53 - shell: zsh
54 version: '@composio/cli@0.3.1'
55
56 steps:
57 - name: Checkout
58 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
59
60 - name: Setup Node.js, pnpm, Bun
61 uses: ./.github/actions/setup-node-pnpm-bun
62
63 - name: Install dependencies
64 run: pnpm install --frozen-lockfile
65
66 # Build the image here rather than inside the test's beforeAll hook, so
67 # its layers come from the GitHub Actions cache and a registry failure
68 # surfaces as a visible, retryable step failure.
69 - name: Pre-build installer image
70 uses: ./.github/actions/build-e2e-image
71 with:
72 dockerfile: ts/e2e-tests/_utils/Dockerfile.install
73 tag: composio-e2e-install:${{ matrix.shell }}
74 cache-scope: e2e-install-${{ matrix.shell }}
75 build-args: |
76 INSTALL_SHELL=${{ matrix.shell }}
77 labels: |
78 composio.e2e=true
79 composio.runtime=cli-install
80 composio.install_shell=${{ matrix.shell }}
81
82 - name: Test production installer
83 env:
84 COMPOSIO_INSTALL_E2E_MODE: prod
85 COMPOSIO_INSTALL_E2E_SHELL: ${{ matrix.shell }}
86 COMPOSIO_INSTALL_E2E_VERSION: ${{ matrix.version }}
87 run: pnpm test:e2e:install
88
89 - name: Send Slack notification on failure
90 if: failure()
91 uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
92 with:
93 webhook: ${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}
94 webhook-type: incoming-webhook
95 payload: |
96 {
97 "text": "CLI install E2E failed\n*Case:* ${{ matrix.shell }} / ${{ matrix.version }}\n*Repository:* ${{ github.repository }}\n*Run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Commit:* ${{ github.sha }}"
98 }
99
100 build-local-fixture:
101 name: Build local install fixture
102 if: github.event_name == 'pull_request'
103 runs-on: ubuntu-latest
104 timeout-minutes: 25
105
106 steps:
107 - name: Checkout
108 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
109
110 - name: Setup Node.js, pnpm, Bun
111 uses: ./.github/actions/setup-node-pnpm-bun
112 with:
113 enable-turbo-cache: 'true'
114 cache-save: 'false'
115
116 - name: Install dependencies
117 run: pnpm install --frozen-lockfile
118
119 - name: Typecheck install E2E suite
120 run: pnpm turbo typecheck --filter=@e2e-tests/cli-install
121
122 - name: Build packages
123 run: pnpm build:packages
124
125 - name: Test upgrade through an entry-point symlink
126 working-directory: ts/packages/cli
127 run: pnpm vitest run test/src/services/upgrade-binary.test.ts
128
129 - name: Build and package Linux fixture
130 working-directory: ts/packages/cli
131 env:
132 RELEASE_TAG: '@composio/cli@98.0.0'
133 run: |
134 pnpm build:binary:cross --target bun-linux-x64
135 pnpm build:binary:package
136 pnpm build:binary:checksums
137
138 - name: Verify and stage fixture
139 working-directory: ts/packages/cli
140 run: |
141 set -euo pipefail
142 fixture_dir="$RUNNER_TEMP/cli-install-fixture"
143 mkdir -p "$fixture_dir"
144 cp dist/binaries/composio-linux-x64.zip dist/binaries/checksums.txt "$fixture_dir/"
145 unzip -p "$fixture_dir/composio-linux-x64.zip" composio-linux-x64/release-tag.txt \
146 | grep -Fx '@composio/cli@98.0.0'
147 verify_dir=$(mktemp -d)
148 unzip -q "$fixture_dir/composio-linux-x64.zip" -d "$verify_dir"
149 test "$("$verify_dir/composio-linux-x64/composio" --version)" = 98.0.0
150
151 - name: Upload local fixture
152 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
153 with:
154 name: cli-install-linux-x64
155 path: ${{ runner.temp }}/cli-install-fixture
156 retention-days: 1
157
158 local-install:
159 name: Local install (${{ matrix.shell }})
160 if: github.event_name == 'pull_request'
161 needs: build-local-fixture
162 runs-on: ubuntu-latest
163 timeout-minutes: 20
164 strategy:
165 fail-fast: false
166 matrix:
167 shell: [zsh, bash, fish]
168
169 steps:
170 - name: Checkout
171 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
172
173 - name: Setup Node.js, pnpm, Bun
174 uses: ./.github/actions/setup-node-pnpm-bun
175 with:
176 cache-save: 'false'
177
178 - name: Install dependencies
179 run: pnpm install --frozen-lockfile
180
181 - name: Download local fixture
182 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
183 with:
184 name: cli-install-linux-x64
185 path: ${{ runner.temp }}/cli-install-fixture
186
187 # Build the image here rather than inside the test's beforeAll hook, so
188 # its layers come from the GitHub Actions cache and a registry failure
189 # surfaces as a visible, retryable step failure.
190 - name: Pre-build installer image
191 uses: ./.github/actions/build-e2e-image
192 with:
193 dockerfile: ts/e2e-tests/_utils/Dockerfile.install
194 tag: composio-e2e-install:${{ matrix.shell }}
195 cache-scope: e2e-install-${{ matrix.shell }}
196 build-args: |
197 INSTALL_SHELL=${{ matrix.shell }}
198 labels: |
199 composio.e2e=true
200 composio.runtime=cli-install
201 composio.install_shell=${{ matrix.shell }}
202
203 - name: Test local installer
204 env:
205 COMPOSIO_INSTALL_E2E_MODE: local
206 COMPOSIO_INSTALL_E2E_SHELL: ${{ matrix.shell }}
207 COMPOSIO_INSTALL_E2E_RELEASE_DIR: ${{ runner.temp }}/cli-install-fixture
208 run: pnpm test:e2e:install
209
210 # The base installer resolves the CLI release at run time, so the checked-in
211 # scripts on any branch are complete working installers. Once the hermetic
212 # suite passes, hand reviewers copy-paste commands that exercise this PR's
213 # installer logic against the latest published release.
214 preview-comment:
215 name: Post installer preview comment
216 if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
217 needs: local-install
218 runs-on: ubuntu-latest
219 timeout-minutes: 5
220 permissions:
221 pull-requests: write
222 steps:
223 - name: Render preview comment
224 env:
225 RAW_BASE: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.pull_request.head.sha }}
226 run: |
227 set -euo pipefail
228 {
229 echo "### Preview this PR's installer"
230 echo ""
231 echo "The hermetic install E2E suite passed for this commit. These commands run the PR's installer scripts against the **latest published CLI release** — they preview installer behavior, not unreleased binaries."
232 echo ""
233 echo '```sh'
234 echo "curl -fsSL \"$RAW_BASE/install.sh\" | sh"
235 echo "curl -fsSL \"$RAW_BASE/install.sh\" | COMPOSIO_INSTALL_SHELL=none sh"
236 echo '```'
237 echo ""
238 echo "The first command is the default flow: it installs the CLI and configures your shell automatically. The second installs only, without touching shell startup files."
239 echo ""
240 echo "Shell-specific setup routes (the override points the variant at this PR's base installer):"
241 echo ""
242 echo '```sh'
243 for shell in bash zsh fish; do
244 echo "curl -fsSL \"$RAW_BASE/install/$shell.sh\" | COMPOSIO_INSTALL_SCRIPT_URL=\"$RAW_BASE/install.sh\" sh"
245 done
246 echo '```'
247 } > install-preview-comment.txt
248
249 - name: Post installer preview comment
250 uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
251 with:
252 file-path: install-preview-comment.txt
253 comment-tag: cli-install-preview