Split long-running CJS workflow into typecheck + sharded test jobs#27098
Split long-running CJS workflow into typecheck + sharded test jobs#27098
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/986a7d20-890c-451f-be5c-05524c00850f Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/986a7d20-890c-451f-be5c-05524c00850f Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR restructures the cjs.yml GitHub Actions workflow to reduce CI latency and improve test parallelism by separating TypeScript typechecking from test execution and sharding JS tests across a matrix.
Changes:
- Replaced the single
jsjob with a dedicatedjs-typecheckjob. - Added a
js-testsjob that runs tests in a 4-way shard matrix using Vitest sharding flags. - Introduced per-job/per-shard concurrency groups to reduce cancellation contention.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/cjs.yml | Splits typecheck from tests and runs JS tests in a 4-shard matrix with per-shard concurrency grouping. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| strategy: |
There was a problem hiding this comment.
The matrix strategy defaults to fail-fast: true, which will cancel the other test shards as soon as one shard fails. That undermines the stated goal of improving failure triage with sharded execution; consider setting strategy.fail-fast: false so all shards complete and report their failures.
| strategy: | |
| strategy: | |
| fail-fast: false |
| # Keep no-file-parallelism so Vitest sharding has deterministic test scheduling per shard. | ||
| run: cd actions/setup/js && npm run test:js -- --no-file-parallelism --shard=${{ matrix.shard }}/4 |
There was a problem hiding this comment.
The shard total (4) is hard-coded in multiple places (job name, --shard=…/4). This can drift if the matrix size changes; consider defining a single source of truth (e.g., an env var for total shards) and referencing it in the test command (and job name) to avoid mismatches.
cjs.ymlcurrently runs JS typecheck and all tests in a single long-running job, creating a bottleneck for CI latency and failure triage. This change separates concerns and parallelizes the slow path by sharding tests across matrix jobs.Workflow restructuring
jsjob with:js-typecheckfor standalone TypeScript validationjs-testsas a 4-way matrix (shard: [1,2,3,4]) for parallel test executionlint-jsbehavior and triggers intact.Execution model
js-testsnow runs Vitest with explicit shard selection per matrix entry.--no-file-parallelismto keep shard scheduling deterministic.Concurrency isolation
js-typecheck,js-tests-<shard>) to reduce cancellation contention and avoid cross-job interference.