From 052b5f5bf0dd76bc3bc51fde3e704b5de0ffd9df Mon Sep 17 00:00:00 2001 From: Pyseph <45090858+Pyseph@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:09:44 +0100 Subject: [PATCH] perf(ci): split Test Web over two runners with vitest --shard Test Web is the longest job of web pull requests; vitest --shard halves its files per runner. The boot step runs on shard 1 only; Check still gates on test_web as a whole. --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc12d15d17860..b79485088dd11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -287,16 +287,25 @@ jobs: # The web suite is the largest outside the server. In the shared Test job it # started last and ran alone for about 40s after everything else finished. - # release.yml mirrors this test, test_web, and test_server split. + # It is also the longest job of web pull requests, so vitest's `--shard` splits + # its test files (unit and browser alike, by a hash of the path) over two + # runners. The shards repeat only checkout, install and the Chromium restore, + # about 20s. The `Check` job needs `test_web` as a whole, so this adds no + # required status. release.yml mirrors the test, test_web, and test_server + # split but not the web shards: it is not a pull request wait. test_web: permissions: contents: read id-token: write - name: Test Web + name: Test Web ${{ matrix.shard }} needs: changes if: ${{ !cancelled() && needs.changes.outputs.test_web != 'false' }} runs-on: blacksmith-8vcpu-ubuntu-2404 timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + shard: [1, 2] steps: - name: Checkout uses: actions/checkout@v6 @@ -338,10 +347,12 @@ jobs: fi - name: Test - run: vp run --filter @t3tools/web test + run: vp run --filter @t3tools/web test --shard ${{ matrix.shard }}/${{ strategy.job-total }} # Browser tests run source modules; this boots the production chunk graph. + # One shard runs it: the build does not depend on which test files ran. - name: Boot the built web client + if: matrix.shard == 1 run: | vp run --filter @t3tools/web build node apps/web/scripts/verify-built-boot.ts