@devries-cameron20 / t3code-1 / commits / d7b9a689fe
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

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

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

Theo Browne committed Aug 21, 2026 at 01:11 UTC d7b9a689fe8fd68a87cb34f32d67de8695e61ee4
1 file changed +79 -14
.github/workflows/ci.yml
+79 -14
@@ -31,11 +31,6 @@ jobs:
31 cache: true
32 run-install: true
33
34 - - name: Setup Rust
35 - uses: dtolnay/rust-toolchain@stable
36 - with:
37 - components: rustfmt
38 -
34 - name: Ensure Electron runtime is installed
35 run: vp run --filter @t3tools/desktop ensure:electron
36
@@ -45,9 +40,6 @@ jobs:
40 - name: Typecheck
41 run: vpr typecheck
42
48 - - name: Check resource monitor formatting
49 - run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
50 -
43 - name: Build desktop pipeline
44 run: vp run build:desktop
45
@@ -57,6 +49,11 @@ jobs:
49 grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
50 grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
51
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.
57 test:
58 name: Test
59 runs-on: blacksmith-8vcpu-ubuntu-2404
@@ -77,20 +74,65 @@ jobs:
74 cache: true
75 run-install: true
76
80 - - name: Setup Rust
81 - uses: dtolnay/rust-toolchain@stable
82 -
77 - name: Ensure Electron runtime is installed
78 run: vp run --filter @t3tools/desktop ensure:electron
79
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.
114 - name: Test
115 env:
116 T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
117 T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
90 - run: vp run test
118 + 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
133
134 - name: Publish transfer budget report
93 - if: always()
135 + if: always() && steps.transfer_budget.outputs.present == 'true'
136 run: |
137 if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
138 tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
@@ -99,7 +141,7 @@ jobs:
141 fi
142
143 - name: Upload thread transfer result
102 - if: always()
144 + if: always() && steps.transfer_budget.outputs.present == 'true'
145 uses: actions/upload-artifact@v7
146 with:
147 name: thread-transfer-results
@@ -107,6 +149,29 @@ jobs:
149 if-no-files-found: ignore
150 retention-days: 30
151
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 +
175 - name: Test resource monitor
176 run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
177