authorgravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-08-21 01:11:46-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-20 22:11:46-07:00
logd7b9a689fe8fd68a87cb34f32d67de8695e61ee4
treea2b9669e2514c732a60d8c92df6e8bef3223dae7
parente2697d63ec52e719ebd2d4e25baee2cb58243c83
signature Signed by PGP key B5690EEEBB952194

perf(ci): parallelize the test suite and split out Rust checks (#7286)

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

1 files changed, 79 insertions(+), 14 deletions(-)

.github/workflows/ci.yml+79-14
...@@ -31,11 +31,6 @@ jobs:...@@ -31,11 +31,6 @@ jobs:
31 cache: true31 cache: true
32 run-install: true32 run-install: true
3333
34 - name: Setup Rust
35 uses: dtolnay/rust-toolchain@stable
36 with:
37 components: rustfmt
38
39 - name: Ensure Electron runtime is installed34 - name: Ensure Electron runtime is installed
40 run: vp run --filter @t3tools/desktop ensure:electron35 run: vp run --filter @t3tools/desktop ensure:electron
4136
...@@ -45,9 +40,6 @@ jobs:...@@ -45,9 +40,6 @@ jobs:
45 - name: Typecheck40 - name: Typecheck
46 run: vpr typecheck41 run: vpr typecheck
4742
48 - name: Check resource monitor formatting
49 run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
50
51 - name: Build desktop pipeline43 - name: Build desktop pipeline
52 run: vp run build:desktop44 run: vp run build:desktop
5345
...@@ -57,6 +49,11 @@ jobs:...@@ -57,6 +49,11 @@ jobs:
57 grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs49 grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
58 grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs50 grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
5951
52 # Everything except `t3` (apps/server). `--parallel` drops the package
53 # dependency ordering that `vp run` applies by default: these `test` tasks
54 # declare no `dependsOn` and resolve workspace deps from source, so ordering
55 # only bought us idle runners between dependency layers. The concurrency
56 # limit stays at the default 4 so peak load per runner is unchanged.
60 test:57 test:
61 name: Test58 name: Test
62 runs-on: blacksmith-8vcpu-ubuntu-240459 runs-on: blacksmith-8vcpu-ubuntu-2404
...@@ -77,20 +74,65 @@ jobs:...@@ -77,20 +74,65 @@ jobs:
77 cache: true74 cache: true
78 run-install: true75 run-install: true
7976
80 - name: Setup Rust
81 uses: dtolnay/rust-toolchain@stable
82
83 - name: Ensure Electron runtime is installed77 - name: Ensure Electron runtime is installed
84 run: vp run --filter @t3tools/desktop ensure:electron78 run: vp run --filter @t3tools/desktop ensure:electron
8579
80 - name: Test
81 run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
82
83 # apps/server sets `fileParallelism: false`, so its 239 files run strictly
84 # one at a time. Sharding spreads them over separate runners instead of
85 # separate workers, so no two server test files ever share a machine and the
86 # isolation that flag buys is preserved exactly.
87 test_server:
88 name: Test Server ${{ matrix.shard }}
89 runs-on: blacksmith-8vcpu-ubuntu-2404
90 timeout-minutes: 10
91 strategy:
92 fail-fast: false
93 matrix:
94 shard: [1, 2, 3]
95 steps:
96 - name: Checkout
97 uses: actions/checkout@v6
98 with:
99 sparse-checkout: |
100 /*
101 !/.repos/
102 sparse-checkout-cone-mode: false
103
104 - name: Setup Vite+
105 uses: voidzero-dev/setup-vp@v1
106 with:
107 node-version-file: package.json
108 cache: true
109 run-install: true
110
111 # No Electron setup here: `t3` (apps/server) has no Electron dependency
112 # and none of its tests touch the runtime. Only the non-server `test`
113 # job, which covers @t3tools/desktop, needs the download.
86 - name: Test114 - name: Test
87 env:115 env:
88 T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md116 T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
89 T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json117 T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
90 run: vp run test118 run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
119
120 # src/server.test.ts writes the budget report, so exactly one shard
121 # produces these files. Gating the upload on their presence keeps a
122 # single `thread-transfer-results` artifact per run, which is the name
123 # thread-transfer-report.yml resolves.
124 - name: Detect transfer budget report
125 id: transfer_budget
126 if: always()
127 run: |
128 if test -f "${{ runner.temp }}/thread-transfer-result.json"; then
129 echo "present=true" >> "$GITHUB_OUTPUT"
130 else
131 echo "present=false" >> "$GITHUB_OUTPUT"
132 fi
91133
92 - name: Publish transfer budget report134 - name: Publish transfer budget report
93 if: always()135 if: always() && steps.transfer_budget.outputs.present == 'true'
94 run: |136 run: |
95 if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then137 if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
96 tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"138 tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
...@@ -99,7 +141,7 @@ jobs:...@@ -99,7 +141,7 @@ jobs:
99 fi141 fi
100142
101 - name: Upload thread transfer result143 - name: Upload thread transfer result
102 if: always()144 if: always() && steps.transfer_budget.outputs.present == 'true'
103 uses: actions/upload-artifact@v7145 uses: actions/upload-artifact@v7
104 with:146 with:
105 name: thread-transfer-results147 name: thread-transfer-results
...@@ -107,6 +149,29 @@ jobs:...@@ -107,6 +149,29 @@ jobs:
107 if-no-files-found: ignore149 if-no-files-found: ignore
108 retention-days: 30150 retention-days: 30
109151
152 # Split out of Check and Test: both paid ~7-9s to install a Rust toolchain
153 # for checks that take under 3s, on the critical path of every PR.
154 rust:
155 name: Rust
156 runs-on: blacksmith-4vcpu-ubuntu-2404
157 timeout-minutes: 10
158 steps:
159 - name: Checkout
160 uses: actions/checkout@v6
161 with:
162 sparse-checkout: |
163 /*
164 !/.repos/
165 sparse-checkout-cone-mode: false
166
167 - name: Setup Rust
168 uses: dtolnay/rust-toolchain@stable
169 with:
170 components: rustfmt
171
172 - name: Check resource monitor formatting
173 run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
174
110 - name: Test resource monitor175 - name: Test resource monitor
111 run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml176 run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
112177