-
Notifications
You must be signed in to change notification settings - Fork 5.5k
270 lines (241 loc) · 8.78 KB
/
test.yml
File metadata and controls
270 lines (241 loc) · 8.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: Tests
# Comprehensive test orchestrator. Runs the full eliza test suite plus
# focused server/client/plugin slices and the database security guard.
# This is a peer of `ci.yaml` — `ci.yaml` is the canonical lint+typecheck+
# build+core-test gate; this workflow adds the broader integration surface.
on:
pull_request:
branches: [main, develop]
paths-ignore:
- "**/*.md"
- "docs/**"
- "AGENTS.md"
- "CHANGELOG.md"
- "LICENSE"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
push:
branches: [main, develop]
paths-ignore:
- "**/*.md"
- "docs/**"
- "AGENTS.md"
- "CHANGELOG.md"
- "LICENSE"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
workflow_dispatch:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
CI: "true"
BUN_VERSION: "1.3.13"
NODE_VERSION: "23"
NODE_NO_WARNINGS: "1"
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
server-tests:
name: Server Tests
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
PGLITE_WASM_MODE: node
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup workspace dependencies
uses: ./.github/actions/setup-bun-workspace
with:
bun-version: ${{ env.BUN_VERSION }}
install-command: bun install --ignore-scripts --no-frozen-lockfile
skip-avatar-clone: "true"
no-vision-deps: "true"
- name: Run server tests
run: bun run test:server
client-tests:
name: Client Tests
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup workspace dependencies
uses: ./.github/actions/setup-bun-workspace
with:
bun-version: ${{ env.BUN_VERSION }}
install-command: bun install --ignore-scripts --no-frozen-lockfile
skip-avatar-clone: "true"
no-vision-deps: "true"
- name: Run client tests
run: bun run test:client
plugin-tests:
name: Plugin Tests
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup workspace dependencies
uses: ./.github/actions/setup-bun-workspace
with:
bun-version: ${{ env.BUN_VERSION }}
install-command: bun install --ignore-scripts --no-frozen-lockfile
skip-avatar-clone: "true"
no-vision-deps: "true"
- name: Run plugin tests
# Cap step well below the 60m job budget so a flaky plugin
# (most recently plugin-shell rust PTY tests in run 25234887145)
# fails fast instead of burning the whole job's wall clock.
timeout-minutes: 35
run: bun run test:plugins
desktop-contract:
name: Electrobun Desktop Contract
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup workspace dependencies
uses: ./.github/actions/setup-bun-workspace
with:
bun-version: ${{ env.BUN_VERSION }}
install-command: bun install --ignore-scripts --no-frozen-lockfile
- name: Run Electrobun contract tests
working-directory: packages/app-core/platforms/electrobun
run: bun run test
cloud-live-e2e:
name: Cloud Live E2E (Eliza Cloud)
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check cloud secrets
id: cloud
env:
ELIZAOS_CLOUD_API_KEY: ${{ secrets.ELIZAOS_CLOUD_API_KEY != '' && secrets.ELIZAOS_CLOUD_API_KEY || secrets.ELIZACLOUD_API_KEY }}
run: |
if [ -z "${ELIZAOS_CLOUD_API_KEY}" ]; then
echo "::warning::No Eliza Cloud API key configured - skipping optional cloud live E2E."
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Checkout
if: steps.cloud.outputs.skip != 'true'
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup Node.js
if: steps.cloud.outputs.skip != 'true'
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup workspace dependencies
if: steps.cloud.outputs.skip != 'true'
uses: ./.github/actions/setup-bun-workspace
with:
bun-version: ${{ env.BUN_VERSION }}
install-command: bun install --ignore-scripts --no-frozen-lockfile
skip-avatar-clone: "true"
no-vision-deps: "true"
- name: Run Cloud tests
if: steps.cloud.outputs.skip != 'true'
shell: bash
run: |
set -o pipefail
log_file="$(mktemp)"
if bun run --cwd cloud/packages/sdk test:e2e 2>&1 | tee "$log_file"; then
exit 0
fi
if grep -Eiq 'exceeded your current quota|quota exceeded|insufficient[_ -]?(quota|balance|funds|credits?)|billing details|credit balance|please add credits|top[_ -]?up your credits|invalid api key|unauthorized|authentication|status code: 429|too many requests|unexpected error occurred while processing the request|temporarily unavailable|service unavailable|internal server error|overloaded' "$log_file"; then
echo "::warning::Cloud Live E2E skipped because the configured external provider is unavailable."
exit 0
fi
exit 1
env:
ELIZA_LIVE_TEST: "1"
ELIZAOS_CLOUD_API_KEY: ${{ secrets.ELIZAOS_CLOUD_API_KEY != '' && secrets.ELIZAOS_CLOUD_API_KEY || secrets.ELIZACLOUD_API_KEY }}
ELIZA_CLOUD_API_KEY: ${{ secrets.ELIZAOS_CLOUD_API_KEY != '' && secrets.ELIZAOS_CLOUD_API_KEY || secrets.ELIZACLOUD_API_KEY }}
ELIZAOS_CLOUD_BASE_URL: ${{ secrets.ELIZAOS_CLOUD_BASE_URL }}
ELIZA_CLOUD_BASE_URL: ${{ secrets.ELIZAOS_CLOUD_BASE_URL }}
test-status:
name: All Tests Passed
if: always()
needs:
- server-tests
- client-tests
- plugin-tests
- desktop-contract
- cloud-live-e2e
runs-on: ubuntu-24.04
steps:
- name: Check test results
shell: bash
run: |
set -u
echo "=== Required test job results ==="
echo "server-tests: ${{ needs.server-tests.result }}"
echo "client-tests: ${{ needs.client-tests.result }}"
echo "plugin-tests: ${{ needs.plugin-tests.result }}"
echo "desktop-contract: ${{ needs.desktop-contract.result }}"
echo "cloud-live-e2e: ${{ needs.cloud-live-e2e.result }}"
echo "==================================="
strict_results="${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}"
bad=0
for pair in \
"server-tests:${{ needs.server-tests.result }}" \
"client-tests:${{ needs.client-tests.result }}" \
"plugin-tests:${{ needs.plugin-tests.result }}" \
"desktop-contract:${{ needs.desktop-contract.result }}" \
"cloud-live-e2e:${{ needs.cloud-live-e2e.result }}"; do
name="${pair%%:*}"
result="${pair##*:}"
if [ "$result" = "skipped" ] && [ "$strict_results" != "true" ]; then
echo "::warning title=Test gate::Live-only job '${name}' was skipped for this PR context."
continue
fi
if [ "$result" != "success" ]; then
echo "::error title=Test gate::Required job '${name}' finished with '${result}' (expected success)"
bad=1
fi
done
if [ "$bad" -ne 0 ]; then
exit 1
fi
echo "All required test jobs passed."