Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

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

Theo Browned7b9a689fe8f
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 052a8c20c..4b691459e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,11 +31,6 @@ jobs:
cache: true
run-install: true
- - name: Setup Rust
- uses: dtolnay/rust-toolchain@stable
- with:
- components: rustfmt
-
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
@@ -45,9 +40,6 @@ jobs:
- name: Typecheck
run: vpr typecheck
- - name: Check resource monitor formatting
- run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
-
- name: Build desktop pipeline
run: vp run build:desktop
@@ -57,6 +49,11 @@ jobs:
grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
+ # 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
runs-on: blacksmith-8vcpu-ubuntu-2404
@@ -77,20 +74,65 @@ jobs:
cache: true
run-install: true
- - name: Setup Rust
- uses: dtolnay/rust-toolchain@stable
-
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
+ - name: Test
+ run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
+
+ # apps/server sets `fileParallelism: false`, so its 239 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.
+ test_server:
+ name: Test Server ${{ matrix.shard }}
+ runs-on: blacksmith-8vcpu-ubuntu-2404
+ timeout-minutes: 10
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3]
+ 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
+
+ # No Electron setup here: `t3` (apps/server) has no Electron dependency
+ # and none of its tests touch the runtime. Only the non-server `test`
+ # job, which covers @t3tools/desktop, needs the download.
- name: Test
env:
T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
- run: vp run test
+ run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
+
+ # src/server.test.ts writes the budget report, so exactly one shard
+ # produces these files. Gating the upload on their presence keeps a
+ # single `thread-transfer-results` artifact per run, which is the name
+ # thread-transfer-report.yml resolves.
+ - name: Detect transfer budget report
+ id: transfer_budget
+ if: always()
+ run: |
+ if test -f "${{ runner.temp }}/thread-transfer-result.json"; then
+ echo "present=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "present=false" >> "$GITHUB_OUTPUT"
+ fi
- name: Publish transfer budget report
- if: always()
+ if: always() && steps.transfer_budget.outputs.present == 'true'
run: |
if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
@@ -99,7 +141,7 @@ jobs:
fi
- name: Upload thread transfer result
- if: always()
+ if: always() && steps.transfer_budget.outputs.present == 'true'
uses: actions/upload-artifact@v7
with:
name: thread-transfer-results
@@ -107,6 +149,29 @@ jobs:
if-no-files-found: ignore
retention-days: 30
+ # Split out of Check and Test: both paid ~7-9s to install a Rust toolchain
+ # for checks that take under 3s, on the critical path of every PR.
+ rust:
+ name: Rust
+ runs-on: blacksmith-4vcpu-ubuntu-2404
+ timeout-minutes: 10
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ sparse-checkout: |
+ /*
+ !/.repos/
+ sparse-checkout-cone-mode: false
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ components: rustfmt
+
+ - name: Check resource monitor formatting
+ run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
+
- name: Test resource monitor
run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml