forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 1
633 lines (566 loc) · 23.7 KB
/
Copy pathtest.yml
File metadata and controls
633 lines (566 loc) · 23.7 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
name: test
# 显式设置 run-name 为 commit 消息;GitHub Actions 默认 display_title 不再自动回退到 commit 消息
run-name: ${{ github.event.head_commit.message || github.workflow }}
on:
push:
branches:
- dev-smark
pull_request:
branches:
- dev-smark
workflow_dispatch:
concurrency:
group: ${{ github.ref == 'refs/heads/dev-smark' && format('{0}-{1}', github.workflow, github.run_id) || format('{0}-{1}', github.workflow, github.event.pull_request.number || github.ref) }}
cancel-in-progress: true
permissions:
contents: read
checks: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# CI 环境禁止 LSP server 自动下载:macOS/Windows runner 预装 .NET SDK,
# CSharp/FSharp server 会触发 dotnet tool install 下载 roslyn-language-server,
# 耗时 >30s 导致 BOM 测试(.cs 文件触发 CSharp server spawn)超时。
# 所有有 auto-download 的 LSP server 均在 spawn 中检查此 flag。
OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
jobs:
core-required:
name: 必过核心测试 / ${{ matrix.label }} / ${{ matrix.os_label }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- id: opencode-linux
label: packages/opencode
os_label: Linux
runner: ubuntu-latest
command: bun turbo test:ci --filter=opencode --continue=dependencies-successful
junit: packages/opencode/.artifacts/unit/*.xml
- id: opencode-windows
label: packages/opencode
os_label: Windows
runner: windows-latest
command: bun turbo test:ci --filter=opencode --continue=dependencies-successful
junit: packages/opencode/.artifacts/unit/*.xml
- id: core-linux
label: packages/core
os_label: Linux
runner: ubuntu-latest
command: bun run --cwd packages/core test:ci
junit: packages/core/.artifacts/unit/junit.xml
- id: core-windows
label: packages/core
os_label: Windows
runner: windows-latest
command: bun run --cwd packages/core test:ci
junit: packages/core/.artifacts/unit/junit.xml
- id: http-recorder-linux
label: packages/http-recorder
os_label: Linux
runner: ubuntu-latest
command: bun run --cwd packages/http-recorder test:ci
junit: packages/http-recorder/.artifacts/unit/junit.xml
- id: http-recorder-windows
label: packages/http-recorder
os_label: Windows
runner: windows-latest
command: bun run --cwd packages/http-recorder test:ci
junit: packages/http-recorder/.artifacts/unit/junit.xml
# macOS 覆盖:opencode 和 core 包的 64+ 处 process.platform 分支此前从未在 CI 上验证过。
# 不添加 http-recorder-macos:该包无原生依赖也无平台特定代码,Linux+Windows 覆盖已充分。
# OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER 对 macos-latest 正确求值为 'false',无需额外配置。
- id: opencode-macos
label: packages/opencode
os_label: macOS
runner: macos-latest
command: bun turbo test:ci --filter=opencode --continue=dependencies-successful
junit: packages/opencode/.artifacts/unit/*.xml
- id: core-macos
label: packages/core
os_label: macOS
runner: macos-latest
command: bun run --cwd packages/core test:ci
junit: packages/core/.artifacts/unit/junit.xml
defaults:
run:
shell: bash
env:
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ matrix.runner == 'windows-latest' && 'true' || 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Configure git identity
run: |
git config --global user.email "bot@opencode.ai"
git config --global user.name "opencode"
- name: Run required package tests
id: test
run: ${{ matrix.command }}
- name: Check unit report
id: junit
if: always()
run: |
# opencode 产出两个 shard 报告;literal package 路径也由同一 glob 检查兼容。
if compgen -G "${{ matrix.junit }}" > /dev/null; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish required unit report
if: always() && steps.junit.outputs.exists == 'true'
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
with:
report_paths: ${{ matrix.junit }}
check_name: "必过核心测试结果 / ${{ matrix.label }} / ${{ matrix.os_label }}"
detailed_summary: true
include_time_in_summary: true
fail_on_failure: false
- name: Upload required unit artifact
if: always() && steps.junit.outputs.exists == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: required-unit-${{ matrix.id }}-${{ github.run_attempt }}
include-hidden-files: true
if-no-files-found: ignore
retention-days: 14
path: ${{ matrix.junit }}
- name: Write required summary
if: always()
run: |
case "${{ steps.test.outcome }}" in
success) result="通过" ;;
failure) result="失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.test.outcome }}" ;;
esac
{
echo "### 必过核心测试"
echo "| 组件 | 平台 | 结果 | JUnit |"
echo "| --- | --- | --- | --- |"
echo "| ${{ matrix.label }} | ${{ matrix.os_label }} | ${result} | ${{ steps.junit.outputs.exists == 'true' && '已生成' || '未生成' }} |"
} >> "$GITHUB_STEP_SUMMARY"
opentui-required:
# closure、behavior test和consumer typecheck必须同一job执行,避免不同安装图互相掩盖peer漂移。
name: 必过 OpenTUI 0.4.3 consumer gate
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
shell: bash
steps:
- name: Checkout repository with OpenTUI provenance
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Verify immutable OpenTUI closure
# 先锁定source/release/runtime身份,再运行任何可通过缓存误导的应用测试。
working-directory: packages/opencode
run: bun run script/verify-opentui-closure.ts --source-revision-authorized
- name: Run OpenTUI consumer regressions
# 这些测试覆盖Goal CJK、DialogPrompt factory和v2 error的用户可见seam。
working-directory: packages/opencode
run: bun test test/script/upgrade-opentui.test.ts test/cli/cmd/tui/session-layout.test.ts test/cli/cmd/tui/dialog-prompt.test.tsx test/cli/cmd/tui/session-v2-error.test.tsx
- name: Typecheck Solid ecosystem consumers
# 同一Solid realpath会被九个workspace直接或间接消费,不能只验证OpenCode包本身。
run: |
# 这些consumer共享root Solid runtime,必须在同一安装图中验证,不能只检查TUI包。
set -euo pipefail
for package in packages/opencode packages/plugin packages/app packages/ui packages/enterprise packages/desktop packages/console/app packages/console/core packages/sdk/js packages/slack; do
bun run --cwd "$package" typecheck
done
httpapi-required:
name: 必过 HttpApi gate / ${{ matrix.mode }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- mode: coverage
label: 路由覆盖
- mode: auth
label: 鉴权覆盖
- mode: effect
label: Effect 覆盖
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Run HttpApi exerciser gate
id: test
working-directory: packages/opencode
run: bun run script/httpapi-exercise.ts --mode ${{ matrix.mode }} --fail-on-missing --fail-on-skip
- name: Write HttpApi summary
if: always()
run: |
case "${{ steps.test.outcome }}" in
success) result="通过" ;;
failure) result="失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.test.outcome }}" ;;
esac
{
echo "### 必过 HttpApi gate"
echo "| Gate | 说明 | 结果 |"
echo "| --- | --- | --- |"
echo "| ${{ matrix.mode }} | ${{ matrix.label }} | ${result} |"
} >> "$GITHUB_STEP_SUMMARY"
vscode-required:
name: 必过 VSCode SDK 检查
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: package.json
- name: Install VSCode SDK dependencies
working-directory: sdks/vscode
run: bun install
- name: Compile VSCode SDK tests
working-directory: sdks/vscode
run: bun run compile-tests
- name: Package VSCode SDK
id: package
working-directory: sdks/vscode
run: bun run package
- name: Write VSCode SDK summary
if: always()
run: |
case "${{ steps.package.outcome }}" in
success) result="通过" ;;
failure) result="失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.package.outcome }}" ;;
esac
{
echo "### 必过 VSCode SDK 检查"
echo "| 组件 | 检查内容 | 结果 |"
echo "| --- | --- | --- |"
echo "| sdks/vscode | compile-tests + package(check-types/lint/esbuild) | ${result} |"
} >> "$GITHUB_STEP_SUMMARY"
upstream-unit-warning:
name: 警告 上游单元兼容性 / ${{ matrix.os_label }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 75
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- os_label: Linux
runner: ubuntu-latest
- os_label: Windows
runner: windows-latest
defaults:
run:
shell: bash
env:
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ matrix.runner == 'windows-latest' && 'true' || 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Run upstream unit compatibility tests
id: upstream
continue-on-error: true
# --concurrency=1 串行执行:Windows 上 turbo 并行运行 core:test:ci 与
# opencode:test:ci 时,core:test:ci 输出被缓冲且进程不退出,导致 75m 超时。
# 串行消除并行资源竞争,预期总时长 ~30m(opencode 24m + 其余 <2m + 安装 4m)。
run: bun turbo test:ci --continue=always --summarize --concurrency=1
- name: Warn on upstream unit failures
if: always() && steps.upstream.outcome != 'success'
run: echo "::warning title=上游单元兼容性::${{ matrix.os_label }} 上游全量单元测试存在失败;此结果只作为兼容性警告,不阻断 fork 核心测试。"
- name: Publish upstream unit reports
if: always() && hashFiles('packages/**/.artifacts/unit/*.xml') != ''
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
with:
report_paths: packages/**/.artifacts/unit/*.xml
check_name: "警告 上游单元兼容性 / ${{ matrix.os_label }}"
detailed_summary: true
include_time_in_summary: true
fail_on_failure: false
- name: Upload upstream unit artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: upstream-unit-${{ matrix.os_label }}-${{ github.run_attempt }}
include-hidden-files: true
if-no-files-found: ignore
retention-days: 7
path: packages/**/.artifacts/unit/*.xml
- name: Write upstream unit summary
if: always()
run: |
case "${{ steps.upstream.outcome }}" in
success) result="通过" ;;
failure) result="警告:存在失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.upstream.outcome }}" ;;
esac
{
echo "### 警告 上游单元兼容性"
echo "| 范围 | 平台 | 结果 | 说明 |"
echo "| --- | --- | --- | --- |"
echo "| bun turbo test:ci --continue=always | ${{ matrix.os_label }} | ${result} | 不阻断必过核心测试 |"
} >> "$GITHUB_STEP_SUMMARY"
upstream-extra-warning:
name: 警告 上游额外包测试 / ${{ matrix.label }}
runs-on: ubuntu-latest
timeout-minutes: 45
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- id: llm
label: packages/llm
path: packages/llm
target: ""
- id: enterprise
label: packages/enterprise
path: packages/enterprise
target: test
- id: desktop
label: packages/desktop
path: packages/desktop
target: src
- id: console-core
label: packages/console/core
path: packages/console/core
target: test
- id: console-app
label: packages/console/app
path: packages/console/app
target: test
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Run upstream extra package tests
id: upstream
continue-on-error: true
env:
OPENAI_API_KEY: ${{ matrix.id == 'llm' && 'test-key' || '' }}
run: |
mkdir -p "${{ matrix.path }}/.artifacts/upstream"
if [ -n "${{ matrix.target }}" ]; then
bun test --cwd "${{ matrix.path }}" "${{ matrix.target }}" --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/upstream/junit.xml
else
bun test --cwd "${{ matrix.path }}" --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/upstream/junit.xml
fi
- name: Warn on upstream extra failures
if: always() && steps.upstream.outcome != 'success'
run: echo "::warning title=上游额外包测试::${{ matrix.label }} 存在失败;此结果只作为兼容性警告,不阻断 fork 核心测试。"
- name: Check upstream extra report
id: junit
if: always()
run: |
if [ -f "${{ matrix.path }}/.artifacts/upstream/junit.xml" ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish upstream extra report
if: always() && steps.junit.outputs.exists == 'true'
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
with:
report_paths: ${{ matrix.path }}/.artifacts/upstream/junit.xml
check_name: "警告 上游额外包测试 / ${{ matrix.label }}"
detailed_summary: true
include_time_in_summary: true
fail_on_failure: false
- name: Upload upstream extra artifact
if: always() && steps.junit.outputs.exists == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: upstream-extra-${{ matrix.id }}-${{ github.run_attempt }}
include-hidden-files: true
if-no-files-found: ignore
retention-days: 7
path: ${{ matrix.path }}/.artifacts/upstream/junit.xml
- name: Write upstream extra summary
if: always()
run: |
case "${{ steps.upstream.outcome }}" in
success) result="通过" ;;
failure) result="警告:存在失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.upstream.outcome }}" ;;
esac
{
echo "### 警告 上游额外包测试"
echo "| 组件 | 结果 | JUnit | 说明 |"
echo "| --- | --- | --- | --- |"
echo "| ${{ matrix.label }} | ${result} | ${{ steps.junit.outputs.exists == 'true' && '已生成' || '未生成' }} | 不阻断必过核心测试 |"
} >> "$GITHUB_STEP_SUMMARY"
upstream-e2e-warning:
name: 警告 上游 App E2E / ${{ matrix.os_label }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- os_label: Linux
runner: ubuntu-latest
- os_label: Windows
runner: windows-latest
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Read Playwright version
id: playwright-version
run: |
version=$(node -e 'console.log(require("./package.json").workspaces.catalog["@playwright/test"])')
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ github.workspace }}/.playwright-browsers
key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
- name: Install Playwright system dependencies
if: runner.os == 'Linux'
working-directory: packages/app
# setup-bun 使用 hoisted 安装,显式走根 node_modules 的锁定 CLI,避免 bunx 重新解析到未修复的安装器。
# Windows 上 Bun 执行 .bin shim 会重映射 bin metadata;Node 直接执行 CLI 不触发该边界。
timeout-minutes: 10
run: node ../../node_modules/playwright/cli.js install-deps chromium
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: packages/app
# 浏览器下载和解压发生在 E2E 测试前,独立超时可以防止 install 卡住占满整个 warning job。
# 继续走锁定的 Node CLI,确保安装和测试阶段使用同一个 Playwright 入口。
timeout-minutes: 15
run: node ../../node_modules/playwright/cli.js install chromium
- name: Run upstream app e2e tests
id: e2e
continue-on-error: true
working-directory: packages/app
# 不通过 package script 解析 playwright bin,避免 Windows Bun 再次触发 .bin metadata remap。
run: node ../../node_modules/playwright/cli.js test
env:
CI: true
PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.os_label }}.xml
timeout-minutes: 30
- name: Warn on upstream e2e failures
if: always() && steps.e2e.outcome != 'success'
run: echo "::warning title=上游 App E2E::${{ matrix.os_label }} App E2E 存在失败;此结果只作为兼容性警告,不阻断 fork 核心测试。"
- name: Check upstream e2e report
id: junit
if: always()
run: |
if [ -f "packages/app/e2e/junit-${{ matrix.os_label }}.xml" ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish upstream e2e report
if: always() && steps.junit.outputs.exists == 'true'
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
with:
report_paths: packages/app/e2e/junit-${{ matrix.os_label }}.xml
check_name: "警告 上游 App E2E / ${{ matrix.os_label }}"
detailed_summary: true
include_time_in_summary: true
fail_on_failure: false
- name: Upload upstream e2e artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: upstream-playwright-${{ matrix.os_label }}-${{ github.run_attempt }}
if-no-files-found: ignore
retention-days: 7
path: |
packages/app/e2e/junit-*.xml
packages/app/e2e/test-results
packages/app/e2e/playwright-report
- name: Write upstream e2e summary
if: always()
run: |
case "${{ steps.e2e.outcome }}" in
success) result="通过" ;;
failure) result="警告:存在失败" ;;
cancelled) result="取消" ;;
skipped) result="跳过" ;;
*) result="${{ steps.e2e.outcome }}" ;;
esac
{
echo "### 警告 上游 App E2E"
echo "| 范围 | 平台 | 结果 | 说明 |"
echo "| --- | --- | --- | --- |"
echo "| packages/app Playwright | ${{ matrix.os_label }} | ${result} | 不阻断必过核心测试 |"
} >> "$GITHUB_STEP_SUMMARY"