An open source design system that's fully customizable and agent ready
TypeScript
fix(ci): install dependencies before spec validation (#5788)
Cindy Zhangcc643d03ba89
diff --git a/.github/scripts/spec-owner-workflow.test.mjs b/.github/scripts/spec-owner-workflow.test.mjsindex b486cd08ec..71736df947 100644--- a/.github/scripts/spec-owner-workflow.test.mjs+++ b/.github/scripts/spec-owner-workflow.test.mjs@@ -40,6 +40,34 @@ describe('spec-only workflow contract', () => {expect(lint).toContain('node scripts/check-knowledge.mjs');});+ 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 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)).not.toContain('\n if:');+ expect(docsiteJob.slice(build, generate)).toContain(+ "if: needs.check-scope.outputs.spec_only != 'true'",+ );+ expect(docsiteJob.slice(generate)).toContain(+ "if: needs.check-scope.outputs.spec_only != 'true'",+ );+ });+it('fails closed when file APIs are truncated or scope classification fails', () => {const ci = read('.github/workflows/ci.yml');expect(ci).toContain('if: ${{ always() && !cancelled() }}');diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex be5d6a4cb4..193f5042a8 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -77,13 +77,14 @@ jobs:- uses: actions/checkout@v7+ # Spec validation imports the canonical CLI discovery path, so the+ # lightweight docs path needs workspace dependencies too.+ - uses: ./.github/actions/setup+- name: Validate spec recordsif: needs.check-scope.outputs.spec_only == 'true'run: node scripts/check-knowledge.mjs- - uses: ./.github/actions/setup- if: needs.check-scope.outputs.spec_only != 'true'-# 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".