Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci: split the slowest PR CI jobs into parallel legs (#7705)

Joeye68a7d624ff2
diff --git a/.github/scripts/ci-docsite-browser.test.mjs b/.github/scripts/ci-docsite-browser.test.mjs
index 2584d7b79b..337bb05fb7 100644
--- a/.github/scripts/ci-docsite-browser.test.mjs
+++ b/.github/scripts/ci-docsite-browser.test.mjs
@@ -18,15 +18,23 @@ const {jobs} = yaml.parse(
);
const owner = jobs['docsite-test'];
const browser = jobs['docsite-browser'];
+const data = jobs['docsite-data'];
const guard = owner.steps.find(
step => step.name === 'Require successful docsite browser contract',
);
+const dataGuard = owner.steps.find(
+ step => step.name === 'Require successful docsite data generation and tests',
+);
const ACTIVE =
"needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'";
describe('docsite browser required-check projection', () => {
it('joins the existing required context and uses the same surface route', () => {
- expect(owner.needs).toEqual(['check-scope', 'docsite-browser']);
+ expect(owner.needs).toEqual([
+ 'check-scope',
+ 'docsite-browser',
+ 'docsite-data',
+ ]);
expect(owner.if).toBe(
"${{ github.event_name != 'workflow_dispatch' && needs.check-scope.outputs.release_bump != 'true' && always() && !cancelled() }}",
);
@@ -34,17 +42,27 @@ describe('docsite browser required-check projection', () => {
expect(browser.if).toBe(
`github.event_name != 'workflow_dispatch' && ${ACTIVE}`,
);
+ expect(data.needs).toEqual(['check-scope']);
+ expect(data.if).toBe(
+ `github.event_name != 'workflow_dispatch' && ${ACTIVE}`,
+ );
expect(guard.if).toBe(ACTIVE);
+ expect(dataGuard.if).toBe(ACTIVE);
expect(
- owner.steps.find(step => step.name === 'Generate and test docsite data')
+ data.steps.find(step => step.name === 'Generate and test docsite data')
.if,
).toBe(ACTIVE);
expect(guard.env).toEqual({
DOCSITE_BROWSER_RESULT: '${{ needs.docsite-browser.result }}',
});
+ expect(dataGuard.env).toEqual({
+ DOCSITE_DATA_RESULT: '${{ needs.docsite-data.result }}',
+ });
expect(owner['continue-on-error']).toBeUndefined();
expect(browser['continue-on-error']).toBeUndefined();
+ expect(data['continue-on-error']).toBeUndefined();
expect(guard['continue-on-error']).toBeUndefined();
+ expect(dataGuard['continue-on-error']).toBeUndefined();
const run = browser.steps.find(
step => step.name === 'Run docsite browser contracts',
);
@@ -76,4 +94,14 @@ describe('docsite browser required-check projection', () => {
expect(check.status === 0).toBe(result === 'success');
},
);
+
+ it.each(['success', 'failure', 'cancelled', 'skipped', ''])(
+ 'fails closed for docsite data result %j',
+ result => {
+ const check = spawnSync('sh', ['-e', '-c', dataGuard.run], {
+ env: {...process.env, DOCSITE_DATA_RESULT: result},
+ });
+ expect(check.status === 0).toBe(result === 'success');
+ },
+ );
});
diff --git a/.github/scripts/ci-test-routing.test.mjs b/.github/scripts/ci-test-routing.test.mjs
index 6d7bc05af1..dcb4440537 100644
--- a/.github/scripts/ci-test-routing.test.mjs
+++ b/.github/scripts/ci-test-routing.test.mjs
@@ -60,15 +60,20 @@ const WORKFLOWS = {
lanes: ['test-ui', 'test-node'],
// A PR that only touches docs skips the suite but must still report.
scopeConditional: true,
+ // Each Vitest lane splits its project across matrix legs.
+ sharded: true,
},
'deploy.yml': {
// The push gate also owns the build + typecheck gates, which need each
// other and so ride one lane of their own.
lanes: ['test-ui', 'test-node', 'typecheck'],
scopeConditional: false,
+ sharded: false,
},
};
+const SHARD_ARG = '--shard=${{ matrix.shard }}/${{ strategy.job-total }}';
+
function load(file) {
return yaml.parse(read(`.github/workflows/${file}`));
}
@@ -82,7 +87,7 @@ function runLines(job) {
describe.each(Object.entries(WORKFLOWS))(
'%s test routing',
- (file, {lanes, scopeConditional}) => {
+ (file, {lanes, scopeConditional, sharded}) => {
const workflow = load(file);
it('gives the Node suite more than one Vitest worker', () => {
@@ -123,18 +128,66 @@ describe.each(Object.entries(WORKFLOWS))(
const suites = job.steps.filter(step =>
step.run?.includes('--project ui'),
);
+ expect(job['continue-on-error']).not.toBe(true);
+ for (const suite of suites) {
+ expect(suite['continue-on-error']).not.toBe(true);
+ }
+
+ if (!sharded) {
+ // One conditional step preserves the existing scope gate for both
+ // runs. Exact foreground commands also reject backgrounding or
+ // ignored exits.
+ expect(suites).toHaveLength(1);
+ expect(suites[0].run.trim().split('\n')).toEqual([
+ `pnpm vitest run --project ui --exclude ${benchmark}`,
+ `pnpm vitest run --project ui ${benchmark} --no-file-parallelism`,
+ ]);
+ return;
+ }
- // One conditional step preserves the existing scope gate for both runs.
- // Exact foreground commands also reject backgrounding or ignored exits.
- expect(suites).toHaveLength(1);
- expect(suites[0].run.trim().split('\n')).toEqual([
- `pnpm vitest run --project ui --exclude ${benchmark}`,
+ // Sharded: every leg runs its share without FR23, and exactly one leg
+ // runs FR23 in a later step on the same runner, after its share exited.
+ expect(suites).toHaveLength(2);
+ const [share, isolated] = suites;
+ expect(share.run.trim()).toBe(
+ `pnpm vitest run --project ui --exclude ${benchmark} ${SHARD_ARG}`,
+ );
+ expect(isolated.run.trim()).toBe(
`pnpm vitest run --project ui ${benchmark} --no-file-parallelism`,
- ]);
- expect(job['continue-on-error']).not.toBe(true);
- expect(suites[0]['continue-on-error']).not.toBe(true);
+ );
+ expect(job.steps.indexOf(isolated)).toBeGreaterThan(
+ job.steps.indexOf(share),
+ );
+ expect(isolated.if).toBe(`matrix.shard == 1 && ${share.if}`);
});
+ if (sharded) {
+ it('splits each Vitest lane across legs that together run every file', () => {
+ for (const lane of lanes) {
+ const job = workflow.jobs[lane];
+ const legs = job.strategy?.matrix?.shard;
+ expect(Array.isArray(legs), `${lane} has no shard matrix`).toBe(true);
+ // Legs are numbered 1..n exactly once, so --shard i/n covers all n.
+ expect(legs).toEqual(
+ Array.from({length: legs.length}, (_, index) => index + 1),
+ );
+ expect(Object.keys(job.strategy.matrix)).toEqual(['shard']);
+ expect(job.strategy['fail-fast']).toBe(false);
+ const suites = job.steps.filter(step =>
+ /--project \w+/.test(step.run ?? ''),
+ );
+ // The one step that is not sharded is the isolated FR23 benchmark.
+ const unsharded = suites.filter(
+ step => !step.run.includes(SHARD_ARG),
+ );
+ for (const step of unsharded) {
+ expect(step.run).toContain('Markdown.fr23.perf.test.ts');
+ }
+ expect(suites.length - unsharded.length).toBe(1);
+ }
+ });
+ }
+
it('gives no lane the whole suite', () => {
// A bare `pnpm test` runs every project in one job — the shape that hit
// the wall.
diff --git a/.github/scripts/ci-tooling-routing.test.mjs b/.github/scripts/ci-tooling-routing.test.mjs
index c17e634831..12bfc17005 100644
--- a/.github/scripts/ci-tooling-routing.test.mjs
+++ b/.github/scripts/ci-tooling-routing.test.mjs
@@ -128,7 +128,8 @@ describe('Node-tooling CI routing', () => {
]);
for (const [name, command] of familyCommands) {
const ownerStep = step(ci.jobs['test-node'], name);
- expect(ownerStep.if).toBe(BROAD_ONLY);
+ // One leg of the sharded Node lane owns the theme-family contract.
+ expect(ownerStep.if).toBe(`matrix.shard == 1 && ${BROAD_ONLY}`);
expect(ownerStep.run).toBe(command);
expect(step(ci.jobs['test-build'], name)).toBeUndefined();
}
@@ -138,12 +139,13 @@ describe('Node-tooling CI routing', () => {
expect(
step(ci.jobs['docsite-test'], 'Skip docsite work for Node tooling').if,
).toContain(TOOLING_TRUE);
+ expect(ci.jobs['docsite-data'].if).toContain(TOOLING_FALSE);
for (const name of [
'Build core package',
'Build canary component packages',
'Generate and test docsite data',
]) {
- expect(step(ci.jobs['docsite-test'], name).if).toContain(TOOLING_FALSE);
+ expect(step(ci.jobs['docsite-data'], name).if).toContain(TOOLING_FALSE);
}
expect(ci.jobs['build-sandbox'].if).toContain(TOOLING_FALSE);
diff --git a/.github/scripts/shadcn-registry-ci.test.mjs b/.github/scripts/shadcn-registry-ci.test.mjs
index 56cbda8a8b..0ba014b298 100644
--- a/.github/scripts/shadcn-registry-ci.test.mjs
+++ b/.github/scripts/shadcn-registry-ci.test.mjs
@@ -120,6 +120,26 @@ describe('ShadCN registry CI contract', () => {
);
});
+ it('verifies the preview and hidden production registries in separate legs', () => {
+ expect(job.strategy.matrix).toEqual({leg: ['preview', 'production']});
+ expect(job.strategy['fail-fast']).toBe(false);
+ const legOf = {
+ 'Verify hidden production registry contract': 'production',
+ 'Generate and validate the complete preview registry': 'preview',
+ 'Install and build every preview registry item': 'preview',
+ 'Generate the hidden production registry': 'production',
+ 'Verify hidden production discovery surfaces': 'production',
+ 'Install and build every hidden production registry item': 'production',
+ };
+ for (const [name, leg] of Object.entries(legOf)) {
+ expect(step(name).if, name).toBe(
+ `matrix.leg == '${leg}' && ${SPEC_FALSE}`,
+ );
+ }
+ // Every leg builds the packages it exercises.
+ expect(step('Build registry package exports').if).toBe(SPEC_FALSE);
+ });
+
it('builds every workspace package before exercising local package exports', () => {
expect(step('Build registry package exports').run).toBe('pnpm build');
});
diff --git a/.github/scripts/spec-owner-workflow.test.mjs b/.github/scripts/spec-owner-workflow.test.mjs
index 9dd6f11c81..f4f443f43b 100644
--- a/.github/scripts/spec-owner-workflow.test.mjs
+++ b/.github/scripts/spec-owner-workflow.test.mjs
@@ -168,33 +168,39 @@ describe('spec-only workflow contract', () => {
it('sets up dependencies before spec validation and skips heavy spec-only work', () => {
const ci = read('.github/workflows/ci.yml');
- const jobStart = ci.indexOf(' docsite-test:');
- const jobEnd = ci.indexOf('\n check-components:', jobStart);
- const docsiteJob = ci.slice(jobStart, jobEnd);
+ const block = (start, end) => {
+ const from = ci.indexOf(` ${start}:`);
+ expect(from, start).toBeGreaterThanOrEqual(0);
+ return ci.slice(from, ci.indexOf(`\n ${end}:`, from));
+ };
+ // docsite-test validates spec records itself; the heavy generation lives
+ // in docsite-data, which the spec-only lane never starts.
+ const docsiteJob = block('docsite-test', 'docsite-data');
+ const dataJob = block('docsite-data', 'docsite-browser');
const checkout = docsiteJob.indexOf('- uses: actions/checkout@v7');
const setup = docsiteJob.indexOf('- uses: ./.github/actions/setup');
const validate = docsiteJob.indexOf('- name: Validate spec records');
- const build = docsiteJob.indexOf('- name: Build core package');
- const generate = docsiteJob.indexOf(
- '- name: Generate and test docsite data',
- );
expect(checkout).toBeGreaterThanOrEqual(0);
expect(setup).toBeGreaterThan(checkout);
expect(validate).toBeGreaterThan(setup);
- expect(build).toBeGreaterThan(validate);
- expect(generate).toBeGreaterThan(build);
expect(docsiteJob.slice(setup, validate)).toContain(
- "if: needs.check-scope.outputs.tooling_only != 'true'",
+ "if: needs.check-scope.outputs.spec_only == 'true'",
);
- expect(docsiteJob.slice(setup, validate)).not.toContain(
- "needs.check-scope.outputs.spec_only != 'true'",
- );
- expect(docsiteJob.slice(build, generate)).toContain(
+ expect(docsiteJob).not.toContain('- name: Build core package');
+ expect(docsiteJob).not.toContain('- name: Generate and test docsite data');
+
+ const header = dataJob.slice(0, dataJob.indexOf('steps:'));
+ expect(header).toContain("needs.check-scope.outputs.spec_only != 'true'");
+ const build = dataJob.indexOf('- name: Build core package');
+ const generate = dataJob.indexOf('- name: Generate and test docsite data');
+ expect(build).toBeGreaterThanOrEqual(0);
+ expect(generate).toBeGreaterThan(build);
+ expect(dataJob.slice(build, generate)).toContain(
"if: needs.check-scope.outputs.spec_only != 'true'",
);
- expect(docsiteJob.slice(generate)).toContain(
+ expect(dataJob.slice(generate)).toContain(
"if: needs.check-scope.outputs.spec_only != 'true'",
);
});
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b8ad549ae1..13e122a342 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -353,8 +353,12 @@ jobs:
node scripts/release/verify-published.mjs --version "$VERSION"
# Required docsite owner: data tests plus the production browser contract.
+ # Historical required check name (AST-030 FR7). It joins the two docsite
+ # owners, which run side by side: the browser contract (~10 minutes) used to
+ # be followed by this job's own generation and tests (~2.5 minutes). The
+ # spec-only lane validates spec records here, where it always has.
docsite-test:
- needs: [check-scope, docsite-browser]
+ needs: [check-scope, docsite-browser, docsite-data]
if: ${{ github.event_name != 'workflow_dispatch' && needs.check-scope.outputs.release_bump != 'true' && always() && !cancelled() }}
runs-on: 2-core-ubuntu-arm
permissions:
@@ -372,21 +376,40 @@ jobs:
DOCSITE_BROWSER_RESULT: ${{ needs.docsite-browser.result }}
run: test "$DOCSITE_BROWSER_RESULT" = 'success'
+ - name: Require successful docsite data generation and tests
+ if: needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ env:
+ DOCSITE_DATA_RESULT: ${{ needs.docsite-data.result }}
+ run: test "$DOCSITE_DATA_RESULT" = 'success'
+
- name: Skip docsite work for Node tooling
if: needs.check-scope.outputs.tooling_only == 'true'
run: echo "Node-tooling PR — docsite generation is not an owned check"
- uses: actions/checkout@v7
+ if: needs.check-scope.outputs.spec_only == 'true'
# Spec validation imports the canonical CLI discovery path, so the
# lightweight docs path needs workspace dependencies too.
- uses: ./.github/actions/setup
- if: needs.check-scope.outputs.tooling_only != 'true'
+ if: needs.check-scope.outputs.spec_only == 'true'
- name: Validate spec records
if: needs.check-scope.outputs.spec_only == 'true'
run: node scripts/check-knowledge.mjs
+ # Docsite data generation and tests. Its outcome feeds docsite-test.
+ docsite-data:
+ needs: [check-scope]
+ if: github.event_name != 'workflow_dispatch' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ runs-on: 2-core-ubuntu-arm
+ permissions:
+ contents: read
+ steps:
+ - uses: actions/checkout@v7
+
+ - uses: ./.github/actions/setup
+
# Docsite `generate` runs `astryx theme build`, which imports the compiled
# @astryxdesign/core/theme entry (dist/theme/index.js). Build core first so that
# entry exists — otherwise generate fails with "Cannot find module".
@@ -422,7 +445,9 @@ jobs:
docsite-browser:
needs: [check-scope]
if: github.event_name != 'workflow_dispatch' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
- runs-on: 2-core-ubuntu-arm
+ # The longest docsite owner; the Next.js production build uses every core
+ # it gets.
+ runs-on: 4-core-ubuntu
permissions:
contents: read
steps:
@@ -434,21 +459,24 @@ jobs:
run: npx playwright install chromium
# The production build imports every theme package's built entry and the
- # canary component packages, on top of core.
+ # canary component packages, on top of core. Core builds first; the rest
+ # depend on it and not on each other, so they build side by side.
- name: Build docsite workspace dependencies
run: |
pnpm -F @astryxdesign/core build
- pnpm -F @astryxdesign/lab build
- pnpm -F @astryxdesign/charts build
- pnpm -F @astryxdesign/richtext build
- pnpm -F @astryxdesign/vega build
- pnpm -F @astryxdesign/theme-neutral build
- pnpm -F @astryxdesign/theme-matcha build
- pnpm -F @astryxdesign/theme-stone build
- pnpm -F @astryxdesign/theme-gothic build
- pnpm -F @astryxdesign/theme-chocolate build
- pnpm -F @astryxdesign/theme-y2k build
- pnpm -F @astryxdesign/theme-butter build
+ pnpm --workspace-concurrency=4 \
+ -F @astryxdesign/lab \
+ -F @astryxdesign/charts \
+ -F @astryxdesign/richtext \
+ -F @astryxdesign/vega \
+ -F @astryxdesign/theme-neutral \
+ -F @astryxdesign/theme-matcha \
+ -F @astryxdesign/theme-stone \
+ -F @astryxdesign/theme-gothic \
+ -F @astryxdesign/theme-chocolate \
+ -F @astryxdesign/theme-y2k \
+ -F @astryxdesign/theme-butter \
+ build
- name: Build the docsite
run: pnpm -F @astryxdesign/docsite build
@@ -569,8 +597,18 @@ jobs:
# still reports for every PR. This mirrors the `build` join over
# build-storybook + build-sandbox below.
test-ui:
+ name: test-ui (${{ matrix.shard }}/${{ strategy.job-total }})
needs: [check-scope]
if: ${{ github.event_name != 'workflow_dispatch' && always() && !cancelled() && needs.check-scope.outputs.spec_only != 'true' }}
+ # One runner ran the whole UI project in ~16 minutes and set the PR's wall
+ # time. Vitest's --shard gives each leg an equal share of the files; the
+ # two slowest files (~3.5 minutes each) bound a leg, so more legs stop
+ # paying. `test` joins the legs: the job result is success only when
+ # every leg passed.
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3, 4]
runs-on: 4-core-ubuntu
permissions:
contents: read
@@ -593,6 +631,7 @@ jobs:
- name: Check knowledge schema history
if: >-
+ matrix.shard == 1 &&
github.event_name == 'pull_request' &&
needs.check-scope.outputs.docsite_only != 'true' &&
needs.check-scope.outputs.spec_only != 'true' &&
@@ -602,38 +641,48 @@ jobs:
node scripts/check-knowledge.mjs --base "${{ github.event.pull_request.base.sha }}"
- name: Check copyright headers
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: ./scripts/add-copyright.sh --check
- name: Check package.json exports are in sync
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: node scripts/sync-exports.js --check
- name: Verify the published CLI ./api type surface
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: node .github/scripts/cli-api-types-verify.mjs
- name: Check token docs are in sync
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: node scripts/generate-token-docs.mjs --check
# Fails when the lab readiness manifest claims a check the source tree
# contradicts — the report is derived, never hand-maintained.
- name: Check lab readiness manifest is current
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: pnpm lab:readiness:check
- # A child process isolates engine state, not CPU or memory contention.
- # FR23 must wait until the other UI workers have exited (AST-036).
- - name: Run UI tests and isolated Markdown benchmark
- run: |
- pnpm vitest run --project ui --exclude packages/core/src/Markdown/Markdown.fr23.perf.test.ts
- pnpm vitest run --project ui packages/core/src/Markdown/Markdown.fr23.perf.test.ts --no-file-parallelism
+ - name: Run this shard of the UI tests
+ run: pnpm vitest run --project ui --exclude packages/core/src/Markdown/Markdown.fr23.perf.test.ts --shard=${{ matrix.shard }}/${{ strategy.job-total }}
if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ # A child process isolates engine state, not CPU or memory contention.
+ # FR23 must wait until this runner's other UI workers have exited
+ # (AST-036); the other shards run on other machines.
+ - name: Run the isolated Markdown benchmark
+ run: pnpm vitest run --project ui packages/core/src/Markdown/Markdown.fr23.perf.test.ts --no-file-parallelism
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+
test-node:
+ name: test-node (${{ matrix.shard }}/${{ strategy.job-total }})
needs: [check-scope]
if: ${{ github.event_name != 'workflow_dispatch' && always() && !cancelled() && needs.check-scope.outputs.spec_only != 'true' }}
+ # One runner ran the Node project in ~12 minutes. Vitest's --shard splits
+ # the files across the legs; `test` joins them.
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3, 4]
# Vitest runs one test file per CPU beyond the first, so the 2-core runner
# ran this suite one file at a time (~23 min). Four cores give it three.
runs-on: 4-core-ubuntu
@@ -656,34 +705,43 @@ jobs:
- uses: ./.github/actions/setup
if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true'
- - run: pnpm vitest run --project node
+ - run: pnpm vitest run --project node --shard=${{ matrix.shard }}/${{ strategy.job-total }}
if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true'
# Theme-family compilation is owned by `theme-build`, not Build. Until
# that surface has an admitted dedicated lane, broad CI keeps its browser
# contract inside the existing Node test owner rather than `test-build`.
+ # One leg runs it.
- name: Install Playwright for theme-family contract
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: npx playwright install chromium
- name: Build theme-family compiler dependencies
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: pnpm -F @astryxdesign/core build
- name: Generate the maintained theme-family fixture
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: pnpm -F @astryxdesign/sandbox generate:theme-family
- name: Run theme family cascade guard
- if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
+ if: matrix.shard == 1 && needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true' && needs.check-scope.outputs.tooling_only != 'true'
run: node .github/scripts/theme-family-cascade.js
# Public registry contract. Generation proves schema, dependency, route-lock,
# alias, and release-gating invariants; the final step drives every canonical
# item through the exact pinned ShadCN client and compiles every written source.
registry-contract:
+ name: registry-contract (${{ matrix.leg }})
needs: [check-scope]
if: ${{ github.event_name != 'workflow_dispatch' && always() && !cancelled() && needs.check-scope.outputs.spec_only != 'true' }}
+ # The preview and hidden production registries are generated and verified
+ # independently, so each gets its own leg (~9 minutes in one job). `test`
+ # joins them: the job result is success only when both passed.
+ strategy:
+ fail-fast: false
+ matrix:
+ leg: [preview, production]
runs-on: 4-core-ubuntu
timeout-minutes: 30
permissions:
@@ -710,34 +768,34 @@ jobs:
run: pnpm build
- name: Verify hidden production registry contract
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'production' && needs.check-scope.outputs.spec_only != 'true'
run: node internal/shadcn-registry/verify-production-gate.mjs
- name: Generate and validate the complete preview registry
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'preview' && needs.check-scope.outputs.spec_only != 'true'
env:
DOCSITE_TARGET: canary
run: node apps/docsite/scripts/generate-data.mjs
- name: Install and build every preview registry item
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'preview' && needs.check-scope.outputs.spec_only != 'true'
run: node internal/shadcn-registry/verify-full-catalog.mjs
- name: Generate the hidden production registry
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'production' && needs.check-scope.outputs.spec_only != 'true'
env:
DOCSITE_TARGET: latest
run: node apps/docsite/scripts/generate-data.mjs
- name: Verify hidden production discovery surfaces
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'production' && needs.check-scope.outputs.spec_only != 'true'
env:
ASTRYX_VERIFY_HIDDEN_PRODUCTION: '1'
NEXT_PUBLIC_DOCS_TARGET: latest
run: pnpm -F @astryxdesign/docsite exec vitest run src/__tests__/hidden-shadcn-production.test.ts
- name: Install and build every hidden production registry item
- if: needs.check-scope.outputs.spec_only != 'true'
+ if: matrix.leg == 'production' && needs.check-scope.outputs.spec_only != 'true'
env:
ASTRYX_SHADCN_USE_PUBLISHED_PACKAGES: '1'
run: node internal/shadcn-registry/verify-full-catalog.mjs
@@ -3192,10 +3250,12 @@ jobs:
needs.check-components.outputs.has_stable_visual == 'true' &&
needs.check-components.outputs.broad_stable_visual == 'true') ||
(github.event_name == 'workflow_dispatch' && inputs.operation == 'release-check'))
+ # Five legs: at three, each leg's scout took ~4.5 minutes and the visual
+ # regression waited for the slowest one.
strategy:
fail-fast: false
matrix:
- shard: [1, 2, 3]
+ shard: [1, 2, 3, 4, 5]
# Four pages on four cores: the scout is page-load bound, and on the rig
# this cut a shard's scout by a quarter against two pages on two cores.
runs-on: 4-core-ubuntu