Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

ci: split the Windows suite into two shards (#325)

Matthew Kissinger065134d77380
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 44abae7b..ae306113 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -133,8 +133,12 @@ jobs:
run: test "$COVERAGE" = success && test "$EXPORTER" = success
windows-checks:
- name: typecheck · lint · test (Windows)
+ name: typecheck · lint · test (Windows shard ${{ matrix.shard }})
runs-on: windows-2022
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2]
# Blocking as of 2026-09-12, on accumulated evidence rather than on one clean run.
#
# It landed reporting-only because a retained Windows coverage run had aborted on
@@ -195,10 +199,14 @@ jobs:
- name: Restore pinned historical regression inputs
run: node scripts/example-archive.mjs --fetch
+ # Two jobs rather than concurrent processes in one: spawning tests time out when
+ # they contend for a runner, and Windows was CI's longest job once the Linux passes
+ # moved apart.
- name: Unit tests
- run: bun run test
+ run: bun run test --shard=${{ matrix.shard }}/2
- name: Verify experimental exporter worker and cache isolation
+ if: ${{ matrix.shard == 1 }}
run: node scripts/exporter-cli-check.mjs
# Diagnostic only, and deliberately failure-tolerant: it exists so that IF the
@@ -213,6 +221,18 @@ jobs:
node -p "'node ' + process.version"
node -e "console.log('sharp versions:', JSON.stringify(require('sharp').versions))"
+ # Keeps main's required Windows context behind the shards, as `checks-gate` does for Linux.
+ windows-checks-gate:
+ name: typecheck · lint · test (Windows)
+ needs: windows-checks
+ if: always()
+ runs-on: ubuntu-latest
+ steps:
+ - name: Require every Windows shard
+ env:
+ SHARDS: ${{ needs.windows-checks.result }}
+ run: test "$SHARDS" = success
+
render-service-checks:
name: render service tests
runs-on: ubuntu-latest
diff --git a/scripts/prepare-npm-release.mjs b/scripts/prepare-npm-release.mjs
index ea414447..59454890 100644
--- a/scripts/prepare-npm-release.mjs
+++ b/scripts/prepare-npm-release.mjs
@@ -15,6 +15,8 @@ export const RELEASE_JOBS = [
'typecheck · lint · coverage',
'engine tests · community exporter',
'typecheck · lint · test (Windows)',
+ 'typecheck · lint · test (Windows shard 1)',
+ 'typecheck · lint · test (Windows shard 2)',
'render service tests',
'build portable Node package',
'Node package · macOS arm64',
diff --git a/scripts/prepare-npm-release.test.mjs b/scripts/prepare-npm-release.test.mjs
index c5c756f7..8e7bd28e 100644
--- a/scripts/prepare-npm-release.test.mjs
+++ b/scripts/prepare-npm-release.test.mjs
@@ -247,6 +247,8 @@ test('release receipt requirements stay aligned with the CI platform matrix', as
if (!matrix) return [job.name];
if (matrix.include)
return matrix.include.map((item) => job.name.replace(/\$\{\{ matrix\.arch \}\}/, item.arch));
+ if (matrix.shard)
+ return matrix.shard.map((shard) => job.name.replace(/\$\{\{ matrix\.shard \}\}/, shard));
return matrix.node.map((node) => job.name.replace(/\$\{\{ matrix\.node \}\}/, node));
});
expect([...RELEASE_JOBS].sort()).toEqual(names.sort());
diff --git a/scripts/reliability.test.mjs b/scripts/reliability.test.mjs
index a6290810..8249f360 100644
--- a/scripts/reliability.test.mjs
+++ b/scripts/reliability.test.mjs
@@ -185,6 +185,8 @@ describe('repository reliability contracts', () => {
'typecheck \u00b7 lint \u00b7 coverage',
'engine tests \u00b7 community exporter',
'typecheck \u00b7 lint \u00b7 test (Windows)',
+ 'typecheck \u00b7 lint \u00b7 test (Windows shard 1)',
+ 'typecheck \u00b7 lint \u00b7 test (Windows shard 2)',
];
// Derived from the workflow rather than restated, so a renamed or added job is a
@@ -201,6 +203,12 @@ describe('repository reliability contracts', () => {
.split(',')
.map((node) => node.trim());
if (nodes) return nodes.map((node) => declared.replace(/\$\{\{ matrix\.node \}\}/u, node));
+ const shards = job
+ .match(/^ {8}shard: \[([^\]]+)\]$/mu)?.[1]
+ .split(',')
+ .map((shard) => shard.trim());
+ if (shards)
+ return shards.map((shard) => declared.replace(/\$\{\{ matrix\.shard \}\}/u, shard));
return legs.length > 0
? legs.map((arch) => declared.replace(/\$\{\{ matrix\.arch \}\}/u, arch))
: [declared];