fix(ci): trim dist fanout from source-only node shards

This commit is contained in:
Vincent Koc
2026-04-14 20:40:53 +01:00
parent c8003f1b33
commit fdbb0fb561
3 changed files with 40 additions and 1 deletions

View File

@@ -243,6 +243,7 @@ jobs:
task: "test-shard",
shard_name: shard.shardName,
configs: shard.configs,
requires_dist: shard.requiresDist,
}))
: [],
),
@@ -425,11 +426,18 @@ jobs:
- name: Build Control UI
run: pnpm ui:build
- name: Cache dist build
uses: actions/cache@v5
with:
path: dist/
key: ${{ runner.os }}-dist-build-${{ github.sha }}
- name: Upload dist artifact
uses: actions/upload-artifact@v7
with:
name: dist-build
path: dist/
compression-level: 0
retention-days: 1
- name: Upload A2UI bundle artifact
@@ -640,7 +648,16 @@ jobs:
- name: Configure Node test resources
run: echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
- name: Restore dist cache
id: dist-cache
if: matrix.requires_dist == true
uses: actions/cache@v5
with:
path: dist/
key: ${{ runner.os }}-dist-build-${{ github.sha }}
- name: Download dist artifact
if: matrix.requires_dist == true && steps.dist-cache.outputs.cache-hit != 'true'
uses: actions/download-artifact@v8
with:
name: dist-build
@@ -988,8 +1005,16 @@ jobs:
install-bun: "false"
use-sticky-disk: "false"
- name: Download dist artifact
- name: Restore dist cache
id: build-smoke-dist-cache
if: github.event_name == 'push'
uses: actions/cache@v5
with:
path: dist/
key: ${{ runner.os }}-dist-build-${{ github.sha }}
- name: Download dist artifact
if: github.event_name == 'push' && steps.build-smoke-dist-cache.outputs.cache-hit != 'true'
uses: actions/download-artifact@v8
with:
name: dist-build

View File

@@ -7,6 +7,11 @@ const EXCLUDED_FULL_SUITE_SHARDS = new Set([
]);
const EXCLUDED_PROJECT_CONFIGS = new Set(["test/vitest/vitest.channels.config.ts"]);
const DIST_DEPENDENT_NODE_SHARD_NAMES = new Set([
"core-support-boundary",
"core-runtime",
"agentic",
]);
function formatNodeTestShardCheckName(shardName) {
const normalizedShardName = shardName.startsWith("core-unit-")
@@ -31,6 +36,7 @@ export function createNodeTestShards() {
checkName: formatNodeTestShardCheckName(shard.name),
shardName: shard.name,
configs,
requiresDist: DIST_DEPENDENT_NODE_SHARD_NAMES.has(shard.name),
},
];
});

View File

@@ -24,4 +24,12 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => {
expect(configs).not.toContain("test/vitest/vitest.full-extensions.config.ts");
expect(configs).not.toContain("test/vitest/vitest.extension-telegram.config.ts");
});
it("marks only dist-dependent shards for built artifact restore", () => {
const requiresDistShardNames = createNodeTestShards()
.filter((shard) => shard.requiresDist)
.map((shard) => shard.shardName);
expect(requiresDistShardNames).toEqual(["core-support-boundary", "core-runtime", "agentic"]);
});
});