Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

ci: build model access protocol before checks (#1676)

JustinBao8970c9cfe861
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96164b68c4..df3a1c74a6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -84,6 +84,12 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
+ # @cindy/model-access-protocol exposes only generated dist artifacts.
+ # Build it before any consumer typecheck or test collection resolves the
+ # workspace package.
+ - name: Build model-access protocol
+ run: pnpm --filter @cindy/model-access-protocol build
+
# XDT_SKIP_AGENT_BIN_INSTALL 跳过了 postinstall 的全部 agent 二进制,但
# runtime-configs.ts 模块顶层的 bundledRipgrepDir() 缺 rg 时直接 throw,
# 会让 apps/desktop 单测在收集阶段全挂——ripgrep 必须单独装回来。
@@ -192,6 +198,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
+ - name: Build model-access protocol
+ run: pnpm --filter @cindy/model-access-protocol build
+
- name: Install bundled ripgrep
env:
GITHUB_TOKEN: ${{ github.token }}
diff --git a/scripts/__tests__/test-workspaces.test.mjs b/scripts/__tests__/test-workspaces.test.mjs
index 8adeea4923..9eb3c41ca6 100644
--- a/scripts/__tests__/test-workspaces.test.mjs
+++ b/scripts/__tests__/test-workspaces.test.mjs
@@ -117,6 +117,40 @@ test("client CI owns the complete Desktop Git integration tier", () => {
);
});
+test("client CI builds model-access protocol before consumer checks", () => {
+ const workflow = fs.readFileSync(
+ path.join(ROOT, ".github", "workflows", "ci.yml"),
+ "utf8",
+ ).replace(/\r\n/g, "\n");
+ const jobs = [
+ {
+ name: "verify",
+ body: workflow.match(/\n verify:\n([\s\S]*?)\n windows-unit-shards:/)?.[1],
+ consumerCommand: "run: pnpm --filter desktop typecheck",
+ },
+ {
+ name: "windows-unit-shards",
+ body: workflow.match(/\n windows-unit-shards:\n([\s\S]*?)\n windows-unit:/)?.[1],
+ consumerCommand: "run: pnpm test:unit",
+ },
+ ];
+
+ for (const { name, body, consumerCommand } of jobs) {
+ assert.ok(body, `client CI must define the ${name} job`);
+ const installIndex = body.indexOf("run: pnpm install --frozen-lockfile");
+ const buildIndex = body.indexOf(
+ "run: pnpm --filter @cindy/model-access-protocol build",
+ );
+ const consumerIndex = body.indexOf(consumerCommand);
+ assert.ok(installIndex >= 0, `${name} must install dependencies`);
+ assert.ok(buildIndex > installIndex, `${name} must build protocol after install`);
+ assert.ok(
+ consumerIndex > buildIndex,
+ `${name} must build protocol before consumer checks`,
+ );
+ }
+});
+
test("help groups copyable desktop, binary, and Mobile workflows", async () => {
const { printHelp } = await import("../help.mjs");
const lines = [];