Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 56 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
outputs:
plan: ${{ steps.select.outputs.plan }}
web: ${{ steps.select.outputs.web }}
web_tests: ${{ steps.select.outputs.web_tests }}
crypto: ${{ steps.select.outputs.crypto }}
www: ${{ steps.select.outputs.www }}
mobile: ${{ steps.select.outputs.mobile }}
desktop: ${{ steps.select.outputs.desktop }}
Expand Down Expand Up @@ -177,7 +179,7 @@ jobs:

crypto-web:
needs: plan
if: needs.plan.outputs.web == 'true'
if: needs.plan.outputs.crypto == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
Expand Down Expand Up @@ -242,6 +244,36 @@ jobs:
if-no-files-found: error
retention-days: 14

web-tests:
needs: [plan, crypto-web]
if: needs.plan.outputs.web_tests == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
persist-credentials: false
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: crypto-web-${{ github.sha }}
path: apps/app/generated
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
version: 11.9.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '24'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Verify crypto inputs and run Web and shared client tests
run: |
python3 -B scripts/build-inputs.py check crypto
pnpm install --frozen-lockfile --filter 'vibeface-web...' --filter 'vibeface-mobile...'
pnpm --filter vibeface-web generate-routes
pnpm --filter vibeface-web test
pnpm --filter vibeface-web typecheck
pnpm --filter @vibeface/client test
pnpm --filter @vibeface/client typecheck

mobile-check:
needs: plan
if: ${{ needs.plan.outputs.mobile == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.desktop_only) }}
Expand Down Expand Up @@ -332,7 +364,15 @@ jobs:
- name: Run affected Rust tests except the exact heavy scenarios
env:
CI_PLAN: ${{ needs.plan.outputs.plan }}
run: /usr/bin/time -v python3 scripts/ci.py test --tier fast --plan-env CI_PLAN
run: /usr/bin/time -v python3 scripts/ci.py test --tier fast --plan-env CI_PLAN --timings-file .artifacts/ci-timings/rust-fast.json
- name: Keep Rust fast timing evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: rust-fast-timing-${{ github.sha }}
path: .artifacts/ci-timings/rust-fast.json
if-no-files-found: warn
retention-days: 7

rust-slow:
needs: plan
Expand All @@ -355,7 +395,15 @@ jobs:
- name: Run the exact heavy Node scenarios
env:
CI_PLAN: ${{ needs.plan.outputs.plan }}
run: /usr/bin/time -v python3 scripts/ci.py test --tier slow --plan-env CI_PLAN
run: /usr/bin/time -v python3 scripts/ci.py test --tier slow --plan-env CI_PLAN --timings-file .artifacts/ci-timings/rust-slow.json
- name: Keep Rust slow timing evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: rust-slow-timing-${{ github.sha }}
path: .artifacts/ci-timings/rust-slow.json
if-no-files-found: warn
retention-days: 7

delivery:
needs: plan
Expand Down Expand Up @@ -440,7 +488,10 @@ jobs:
components: rustfmt
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
key: package-${{ matrix.target }}${{ runner.os == 'Windows' && '-static-crt' || '' }}
key: package-with-probe-${{ matrix.target }}-${{ hashFiles('scripts/release-rustflags.py') }}${{ runner.os == 'Windows' && '-static-crt' || '' }}
workspaces: |
. -> target
tests/fixtures/delivery-probe -> ../../../.artifacts/delivery-probe/target
save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
Expand Down Expand Up @@ -1124,7 +1175,7 @@ jobs:
ci-gate:
name: ci-gate
if: ${{ (always() && !(github.event_name == 'workflow_dispatch' && inputs.delivery_small)) && !(github.event_name == 'workflow_dispatch' && (inputs.desktop_only || inputs.windows_only || inputs.mobile_apps != 'none')) }}
needs: [plan, quick-check, crypto-web, web, mobile-check, desktop-check, www, rust-check, rust-fast, rust-slow, delivery, delivery-live, package, npm-package, npm-smoke, windows-native, desktop-macos, desktop-windows]
needs: [plan, quick-check, crypto-web, web, web-tests, mobile-check, desktop-check, www, rust-check, rust-fast, rust-slow, delivery, delivery-live, package, npm-package, npm-smoke, windows-native, desktop-macos, desktop-windows]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ jobs:
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
cache-on-failure: true
key: native-targets-${{ hashFiles('scripts/release-rustflags.py') }}
workspaces: |
. -> target
. -> .artifacts/native/target
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 11.9.0
Expand Down
8 changes: 8 additions & 0 deletions packages/docs/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ description: 查看 Vibeface CI 如何按改动范围选择检查。
| `README.md`、`README.zh-CN.md`、`AGENTS.md`、`CLAUDE.md` | 静态快检,不构建或运行 Rust 测试 |
| `apps/www/`、`packages/docs/` | 门户类型检查、静态构建和产物检查,不运行 Rust 测试 |
| `apps/app/`、Web 构建脚本 | 浏览器密码学互通、Web 测试与类型检查、静态构建、Linux x64 完整包及网页进程验收 |
| `apps/app/src/lib/*.test.ts`、`apps/app/src/features/*/*.test.ts`,限定单层目录 | 浏览器密码学互通和独立 `web-tests`,不组包或构建静态页面 |
| 五个默认浏览器 E2E:chat-confidence、mesh、onboarding、transfers、workspace | Web 构建与真实 Linux 包 E2E,不额外选无关的 Rust workspace 测试或 proof |
| `apps/desktop/src/`、`apps/desktop/tests/` | Linux 上的桌面类型检查、单测和 main/preload 打包,不构建 Rust 或运行网页制品验收 |
| `apps/desktop/src/shared/` | 桌面源码检查,以及直接导入这些文件的 Web 检查和网页制品验收 |
| `apps/mobile/`、`packages/secure-native/` | 独立的 Mobile 与 secure-native 类型检查,同时保留 Web 套件中的手机行为测试 |
Expand All @@ -47,6 +49,8 @@ description: 查看 Vibeface CI 如何按改动范围选择检查。

`desktop-check` 在 Linux 上运行桌面 `typecheck`、`test` 和 `build`,不下载 Electron 程序、不启动窗口,也不替代手动平台验收。桌面安装配置、打包脚本及尚未分类的路径继续选择全工作区检查。

`web-tests` 执行与 Web 构建相同的 Web、共享 Client 行为测试及类型检查,下载并核对本提交的密码学产物。仍安装 Mobile 测试依赖。只有变更全部落在现有单测命令覆盖的路径时,才省去静态构建和组包;同时修改生产源码时由完整 Web job 承担这些检查,不重复运行测试 job。更深层测试、TSX 测试、原生或付费 E2E、公共 fixture 和 E2E 配置保持保守回退。原生 workspace 的手动验收要求保持不变,不把类型检查算作原生行为验收。

`mobile-check` 独立运行共享 Client、secure-native 和 Mobile 类型检查,`ci-gate` 要求它与选中的其他任务都成功。Web 构建脚本不再执行这两项原生类型检查;Web 套件仍包含手机行为测试,并读取手机依赖中的实现,所以暂时保留 Mobile 安装过滤器。移动这些行为测试前,不移除这部分依赖或手机变更对应的 Web 检查。全量事件和未知范围回退同时包含 Mobile、桌面源码检查。

`www` 使用 Node.js 24 和冻结的 pnpm 依赖,依次运行 `typecheck`、`build`、`check:static`,上传 `apps/www/dist/client` 为 `www-<SHA>` 制品。门户与独立 App 分别构建;根 `packages/docs/` 是门户文档正文的唯一来源,修改文档也会触发 `www`。
Expand Down Expand Up @@ -184,6 +188,10 @@ native 创建 fresh 目录后,在原 start 的任何子进程或业务前等

快、慢测试组均使用 `opt-level=1`,保留调试断言和整数溢出检查,调试信息使用 `line-tables-only` 保留回溯文件和行号,共享独立的 `test-opt1` Rust 缓存;Clippy 使用单独的 `check` 缓存。两组运行前校验每个慢测试名恰好匹配一个已有测试。慢组用 `--include-ignored` 运行列出的用例,其他 `ignored` 用例仍默认忽略。两组测试命令用 `/usr/bin/time -v` 记录 CPU 与 maxRSS;maxRSS 不能当作并发进程树的总峰值。

Rust 测试额外记录 `compile`、`enumerate` 和 `execute` 三阶段。先以同一包和测试配置运行 `cargo test --no-run`,再枚举并验证慢测试分组,最后执行原有快、慢测试命令。执行阶段仍包含 Cargo 校验和文档测试准备,不能当作精确的纯测试 CPU 时间。`--timings-file` 将阶段时长和退出码写为 JSON;CI 上传该文件并写入 job summary。编译失败或测试失败继续使 job 失败。

iOS Rust cache 同时覆盖默认 `target/` 和 Host Node 的 `.artifacts/native/target`;Linux 组包 cache 另外覆盖独立 probe workspace 的 `.artifacts/delivery-probe/target`,保留各自 Cargo.lock 的失效规则。Rust/App 缓存键包含实际使用的 `release-rustflags.py`。缓存命中只复用编译输入与依赖,不跳过类型、签名、真实进程或 UI 验收。

CI 不使用真实 AI Provider 或模型密钥。各模式都使用受控 SDK 和 App Server 夹具,`--phase5` 不启动 App Server。模拟协议通过不能证明真实模型理解需求或正确选择工具。

产品 `v<version>` 与官网 `www-v<version>` 分别进入发布路径,必须匹配声明版本,并通过同一共享来源门验证 main 源码或受信机械 Nightly 提交。产品并行构建 Web、四个原生目标、Android 和 iOS,各平台再按自身输入组包并构建桌面 App。每组校验后立即向同一个公开 Release 追加附件,完整审计完成后才追加全局 `release.json`。`publish=false` 手动入口只验证并生成制品。产品与官网制品发布不触发部署;独立部署命令可显式选择已发布的 Stable、RC 或 Nightly Tag;派发成功不代表部署成功。详见 [构建与发布](releasing.md)。
Expand Down
Loading
Loading