From 86781b8a43f36409be146c8d80b260dec8fad7c0 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Mon, 2 Nov 2026 22:50:28 +0100 Subject: [PATCH] ci: run the unit tests in four parallel shards --- .github/workflows/tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb148b067..c85a7c84f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,9 +11,17 @@ permissions: jobs: vitest: - name: Vitest + name: Vitest (${{ matrix.shard }}/4) runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 + # Most of a run is per-file overhead (imports and jsdom setup), not test + # code, so spreading the files over parallel runners cuts the wall time + # almost linearly. fail-fast is off so one red shard doesn't hide failures + # in the others. + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] steps: - name: Checkout uses: actions/checkout@v7 @@ -33,7 +41,7 @@ jobs: # forks + a small worker count keeps the load-sensitive component tests # from timing out on the shared runners; the longer per-test timeout # covers the jsdom-heavy suites. - run: npx vitest run --pool=forks --maxWorkers=2 --testTimeout=15000 + run: npx vitest run --pool=forks --maxWorkers=2 --testTimeout=15000 --shard=${{ matrix.shard }}/4 # The pre-commit hook lints only staged files and never runs on fork PRs, # so this is the one place the whole tree is checked.