From fe91df778bbdfe3453b24c5f2b6c75af0c6ff3c6 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 17:49:30 +0800 Subject: [PATCH] test(ci): preserve worker limits with required publisher smoke --- .github/workflows/ci-windows.yml | 3 ++- .github/workflows/ci.yml | 4 +++- scripts/ci-workflow.spec.ts | 19 ++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 142f4dfbd9..c3ea5c58fc 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -48,7 +48,7 @@ jobs: - uses: pnpm/action-setup@v5.0.0 with: package_json_file: publisher-isolated/package.json - dest: ${{ runner.temp }}/setup-pnpm-publisher-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }} + dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }} - name: Install only publisher production dependencies working-directory: publisher-isolated run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts @@ -63,6 +63,7 @@ jobs: # Blacksmith uses 2 vCPU for file-serial native tests and 16 for coverage # and the shared build/observational workspace. windows-build: + needs: windows-publisher if: github.event_name == 'pull_request' runs-on: >- ${{ vars.DSH_CI_FAILOVER_WINDOWS == 'blacksmith' && 'blacksmith-16vcpu-windows-2025' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74e2355e0..fc83d5c7f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ concurrency: jobs: publisher-isolated: strategy: + max-parallel: 1 fail-fast: false matrix: os: [linux, macos] @@ -46,7 +47,7 @@ jobs: - uses: pnpm/action-setup@v5.0.0 with: package_json_file: publisher-isolated/package.json - dest: ${{ runner.temp }}/setup-pnpm-publisher-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }} + dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }} - name: Install only publisher production dependencies working-directory: publisher-isolated run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts @@ -494,6 +495,7 @@ jobs: node-compat: + needs: publisher-isolated if: github.event_name == 'pull_request' # Under the selfhosted leg this job admits only repository-owned PR code # to the persistent shared VM; the blacksmith branch targets ephemeral diff --git a/scripts/ci-workflow.spec.ts b/scripts/ci-workflow.spec.ts index ed7a360894..56bb3f9303 100644 --- a/scripts/ci-workflow.spec.ts +++ b/scripts/ci-workflow.spec.ts @@ -41,12 +41,17 @@ describe('CI workflow', () => { }) expect(workflowJob(ci, 'all-checks-passed').needs).toContain('node-compat') const ordinaryJobs = Object.entries(ci.jobs) - .filter(([name]) => !['node-compat', 'all-checks-passed'].includes(name)) + .filter(([name]) => !['node-compat', 'all-checks-passed', 'publisher-isolated'].includes(name)) for (const [name, job] of ordinaryJobs) { if (!isRecord(job)) throw new TypeError(`${name} must define a job`) expect(job).not.toHaveProperty('strategy') expect(job).not.toHaveProperty('uses') } + // Publisher smoke reuses the compatibility/build concurrency slots before those jobs start. + expect(compatibility.needs).toBe('publisher-isolated') + expect(workflowJob(ci, 'publisher-isolated').strategy).toMatchObject({ 'max-parallel': 1, matrix: { os: ['linux', 'macos'] } }) + expect(workflowJob(ciWindows, 'windows-build').needs).toBe('windows-publisher') + expect(workflowJob(ciWindows, 'windows-publisher').defaults).toEqual({ run: { shell: 'pwsh' } }) // Python reports its own required verdict, so neither its jobs nor a // reusable workflow caller remain in the Linux or Windows workflow. expect(Object.keys(ci.jobs).filter(name => name.startsWith('python'))).toEqual([]) @@ -60,7 +65,7 @@ describe('CI workflow', () => { expect(runtime.with).toMatchObject({ targets: 'node24-linux-x64,node24-win-x64' }) expect(runtime.uses).toBe('./.github/workflows/build-exe-for-python-sdk.yml') const windowsJobs = Object.entries(ciWindows.jobs) - .filter(([name]) => name !== 'windows-checks-passed') + .filter(([name]) => !['windows-checks-passed', 'windows-publisher'].includes(name)) for (const [name, job] of windowsJobs) { if (!isRecord(job)) throw new TypeError(`${name} must define a job`) expect(job).not.toHaveProperty('strategy') @@ -95,7 +100,7 @@ describe('CI workflow', () => { expect(afterSdk).toBeLessThanOrEqual(11) }) - it('keeps the union of required PR verdicts equal to the pre-split blocking set', () => { + it('keeps required PR verdicts covering runtime and publisher jobs', () => { const verdicts = [ ['ci.yml', 'all-checks-passed'], ['ci-windows.yml', 'windows-checks-passed'], @@ -112,9 +117,7 @@ describe('CI workflow', () => { expect(verdict.needs.every(id => typeof id === 'string' && id in jobs)).toBe(true) blocking.push(...(verdict.needs as string[])) } - // Splitting the workflows only moves jobs between verdicts; the blocking - // set itself must stay identical, or branch protection would accept a - // failure it rejected before the split. + // Every blocking lane must contribute to a branch-protection verdict. expect(blocking.sort()).toEqual([ 'node-24', 'node-24-bench', @@ -122,10 +125,12 @@ describe('CI workflow', () => { 'node-24-coverage', 'node-24-lint', 'node-compat', + 'publisher-isolated', 'python-runtime', 'python-sdk', 'windows-build', 'windows-native-tests', + 'windows-publisher', ]) }) @@ -547,7 +552,7 @@ describe('CI workflow', () => { expect(aggregate.needs).not.toContain('windows') // windows-coverage is temporarily non-blocking while Windows ACP // half-close tests are stabilized; observational stays out too. - expect(windowsAggregate.needs).toEqual(['windows-build', 'windows-native-tests']) + expect(windowsAggregate.needs).toEqual(['windows-publisher', 'windows-build', 'windows-native-tests']) expect(windowsAggregate.name).toBe('windows checks passed') expect(windowsAggregate['runs-on']).toBe(aggregate['runs-on']) expect(windowsAggregate.if).toBe(aggregate.if)