perf(ci): run PR checks side by side and balance server shards (#14025)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-09-30 21:44:49 -07:00
1 parent 67b175a4c9
commit 6f8e2534f2
7 files changed
+352 -33

No files matched your search

+169 -33
View File
@@ -14,8 +14,11 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check:
name: Check
# Lint, typecheck, and the desktop build each get a runner so they run side by
# side instead of one after another. The `Check` job at the end of this file
# passes only when every other job does.
lint:
name: Lint
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
@@ -52,29 +55,8 @@ jobs:
- name: Check
run: vp check
- name: Typecheck
run: vpr typecheck
- uses: ./.github/actions/setup-apt-mirrors
- name: Install browser secret helper build libraries
run: |
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
- name: Build desktop pipeline
run: vp run build:desktop
- name: Verify preload bundle output
run: node apps/desktop/scripts/verify-preload-bundle.mjs
# Everything except `t3` (apps/server). `--parallel` drops the package
# dependency ordering that `vp run` applies by default: these `test` tasks
# declare no `dependsOn` and resolve workspace deps from source, so ordering
# only bought us idle runners between dependency layers. The concurrency
# limit stays at the default 4 so peak load per runner is unchanged.
test:
name: Test
typecheck:
name: Typecheck
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
@@ -96,12 +78,98 @@ jobs:
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Typecheck
run: vpr typecheck
build:
name: Build
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- uses: ./.github/actions/setup-apt-mirrors
- name: Install browser secret helper build libraries
# Runs in the background while Vite+ installs; the step before the build waits for it.
- name: Start installing browser secret helper build libraries
run: |
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
(
set +e
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
echo "$?" > "$RUNNER_TEMP/apt-status"
) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Finish installing browser secret helper build libraries
timeout-minutes: 5
run: |
until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
cat "$RUNNER_TEMP/apt.log"
exit "$(cat "$RUNNER_TEMP/apt-status")"
- name: Build desktop pipeline
run: vp run build:desktop
- name: Verify preload bundle output
run: node apps/desktop/scripts/verify-preload-bundle.mjs
# Everything except `t3` (apps/server) and the web app, which has its own job
# below. `--parallel` drops the package dependency ordering that `vp run`
# applies by default: these `test` tasks declare no `dependsOn` and resolve
# workspace deps from source, so ordering only bought us idle runners between
# dependency layers. The concurrency limit stays at the default 4 so peak load
# per runner is unchanged.
test:
name: Test
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- uses: ./.github/actions/setup-apt-mirrors
# The desktop tests compile the browser secret helper. The install runs in
# the background while Vite+ installs; the step before the tests waits for it.
- name: Start installing browser secret helper build libraries
run: |
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
(
set +e
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
echo "$?" > "$RUNNER_TEMP/apt-status"
) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Test preview artifact validation
run: python3 -B .github/scripts/stage-preview-bundle.test.py
@@ -109,21 +177,55 @@ jobs:
- name: Test nightly release checks
run: node --test .github/scripts/check-nightly-release.test.cjs
- name: Test
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
- name: Finish installing browser secret helper build libraries
timeout-minutes: 5
run: |
until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
cat "$RUNNER_TEMP/apt.log"
exit "$(cat "$RUNNER_TEMP/apt-status")"
# apps/server sets `fileParallelism: false`, so its 239 files run strictly
- name: Test
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' --filter '!@t3tools/web' test
# 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.
test_web:
name: Test Web
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
/*
!/.repos/
sparse-checkout-cone-mode: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Test
run: vp run --filter @t3tools/web test
# apps/server sets `fileParallelism: false`, so its test files run strictly
# one at a time. Sharding spreads them over separate runners instead of
# separate workers, so no two server test files ever share a machine and the
# isolation that flag buys is preserved exactly.
# isolation that flag buys is preserved exactly. One file at a time keeps
# about 1.5 cores busy, so 4 vCPU runners lose nothing against 8. The shards
# split files by recorded duration (apps/server/src/testUtils/weightedShardSequencer.ts).
test_server:
name: Test Server ${{ matrix.shard }}
runs-on: blacksmith-8vcpu-ubuntu-2404
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]
shard: [1, 2, 3, 4, 5, 6]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -347,3 +449,37 @@ jobs:
- name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts
# Branch protection requires this job by its name, `Check`. It fails when any
# other job fails, is cancelled, or is skipped without a reason, so splitting
# or resharding jobs needs no ruleset change. Add every new job to `needs`.
# `always()` rather than `!cancelled()`: a skipped job reports success to
# branch protection, so a cancelled run must still produce a failing check.
check:
name: Check
if: ${{ always() }}
needs:
[
lint,
typecheck,
build,
test,
test_web,
test_server,
rust,
mobile_native_changes,
mobile_native_static_analysis,
release_smoke,
]
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 5
steps:
- name: Require every job to pass
env:
RESULTS: ${{ toJSON(needs) }}
run: |
echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"'
# Only the macOS lint skips on purpose, when no native mobile code changed.
echo "$RESULTS" | jq -e 'all(to_entries[];
.value.result == "success"
or (.key == "mobile_native_static_analysis" and .value.result == "skipped"))' > /dev/null