Open History to see the last commit
1name: CI
2
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8
9concurrency:
10 group: ci-${{ github.event.pull_request.number || github.sha }}
11 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12
13jobs:
14 check:
15 name: Check
16 runs-on: blacksmith-8vcpu-ubuntu-2404
17 timeout-minutes: 10
18 steps:
19 - name: Checkout
20 uses: actions/checkout@v6
21 with:
22 sparse-checkout: |
23 /*
24 !/.repos/
25 sparse-checkout-cone-mode: false
26
27 - name: Setup Vite+
28 uses: voidzero-dev/setup-vp@v1
29 with:
30 node-version-file: package.json
31 cache: true
32 run-install: true
33
34 - name: Setup Rust
35 uses: dtolnay/rust-toolchain@stable
36 with:
37 components: rustfmt
38
39 - name: Ensure Electron runtime is installed
40 run: vp run --filter @t3tools/desktop ensure:electron
41
42 - name: Check
43 run: vp check
44
45 - name: Typecheck
46 run: vpr typecheck
47
48 - name: Check resource monitor formatting
49 run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
50
51 - name: Build desktop pipeline
52 run: vp run build:desktop
53
54 - name: Verify preload bundle output
55 run: |
56 test -f apps/desktop/dist-electron/preload.cjs
57 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.cjs
59
60 test:
61 name: Test
62 runs-on: blacksmith-8vcpu-ubuntu-2404
63 timeout-minutes: 10
64 steps:
65 - name: Checkout
66 uses: actions/checkout@v6
67 with:
68 sparse-checkout: |
69 /*
70 !/.repos/
71 sparse-checkout-cone-mode: false
72
73 - name: Setup Vite+
74 uses: voidzero-dev/setup-vp@v1
75 with:
76 node-version-file: package.json
77 cache: true
78 run-install: true
79
80 - name: Setup Rust
81 uses: dtolnay/rust-toolchain@stable
82
83 - name: Ensure Electron runtime is installed
84 run: vp run --filter @t3tools/desktop ensure:electron
85
86 - name: Test
87 env:
88 T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
89 T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
90 run: vp run test
91
92 - name: Test WSL native ABI auditor
93 run: node --test scripts/audit-wsl-native-abi.test.mjs
94
95 - name: Test Windows/WSL CI contract
96 run: >-
97 node --test
98 scripts/windows-wsl-ci-contract.test.mjs
99 scripts/windows-native-hardening-contract.test.mjs
100 scripts/stage-wsl-ci-node-pty.test.mjs
101 scripts/clean.test.mjs
102 apps/desktop/scripts/ensure-electron-runtime.test.mjs
103 apps/desktop/scripts/windows-process-tree.test.mjs
104 scripts/windows-packaged-lifecycle-contract.test.mjs
105 scripts/windows-persistence-resume-contract.test.mjs
106 scripts/windows-persistence-lock.test.mjs
107
108 - name: Publish transfer budget report
109 if: always()
110 run: |
111 if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
112 tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
113 else
114 echo "Transfer budget report was not produced." >> "$GITHUB_STEP_SUMMARY"
115 fi
116
117 - name: Upload thread transfer result
118 if: always()
119 uses: actions/upload-artifact@v7
120 with:
121 name: thread-transfer-results
122 path: ${{ runner.temp }}/thread-transfer-result.json
123 if-no-files-found: ignore
124 retention-days: 30
125
126 - name: Test resource monitor
127 run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
128
129 windows_native:
130 name: Windows Native
131 runs-on: windows-2025
132 timeout-minutes: 25
133 steps:
134 - name: Checkout
135 uses: actions/checkout@v6
136 with:
137 sparse-checkout: |
138 /*
139 !/.repos/
140 sparse-checkout-cone-mode: false
141
142 - name: Setup Vite+
143 uses: voidzero-dev/setup-vp@v1
144 with:
145 node-version-file: package.json
146 cache: true
147 run-install: true
148
149 - name: Setup Rust
150 uses: dtolnay/rust-toolchain@stable
151 with:
152 components: rustfmt
153
154 - name: Ensure Electron runtime is installed
155 run: vp run --filter @t3tools/desktop ensure:electron
156
157 - name: Check on Windows
158 run: vp check
159
160 - name: Typecheck on Windows
161 run: vpr typecheck
162
163 - name: Test desktop on Windows
164 run: vp run --filter @t3tools/desktop test
165
166 - name: Test shared Windows shell semantics
167 run: vp run --filter @t3tools/shared test
168
169 - name: Test Windows developer tooling
170 run: >-
171 node --test
172 scripts/clean.test.mjs
173 apps/desktop/scripts/ensure-electron-runtime.test.mjs
174 apps/desktop/scripts/windows-process-tree.test.mjs
175 scripts/windows-persistence-lock.test.mjs
176 scripts/windows-persistence-resume-contract.test.mjs
177
178 - name: Test web Windows/WSL path logic
179 run: vp run --filter @t3tools/web test
180
181 - name: Test server on Windows
182 run: vp run --filter t3 test
183
184 - name: Build desktop pipeline on Windows
185 run: vp run build:desktop
186
187 - name: Verify preload bundle output on Windows
188 shell: pwsh
189 run: |
190 $preload = "apps/desktop/dist-electron/preload.cjs"
191 if (-not (Test-Path $preload)) { throw "Missing $preload" }
192 $text = Get-Content -Raw $preload
193 foreach ($needle in @("desktopBridge", "getLocalEnvironmentBootstrap", "PICK_FOLDER_CHANNEL", "wsUrl", "__clerk_internal_electron_passkeys")) {
194 if (-not $text.Contains($needle)) { throw "Preload bundle is missing $needle" }
195 }
196
197 - name: Test Windows resource monitor
198 run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
199
200 - name: Exercise release-only workflow steps on Windows
201 run: node scripts/release-smoke.ts
202
203 wsl_native_ci:
204 name: WSL Native Runtime CI (Ubuntu 22.04 ABI floor)
205 runs-on: ubuntu-24.04
206 container:
207 image: ubuntu:22.04
208 timeout-minutes: 20
209 steps:
210 - name: Bootstrap Ubuntu 22.04 ABI container
211 shell: bash
212 run: |
213 set -euo pipefail
214 apt-get update
215 DEBIAN_FRONTEND=noninteractive apt-get install -y \
216 build-essential \
217 ca-certificates \
218 curl \
219 git \
220 file \
221 python3 \
222 binutils
223 test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.35"
224
225 - name: Checkout
226 uses: actions/checkout@v6
227 with:
228 sparse-checkout: |
229 /*
230 !/.repos/
231 sparse-checkout-cone-mode: false
232
233 - name: Setup Vite+
234 uses: voidzero-dev/setup-vp@v1
235 with:
236 node-version-file: package.json
237 cache: true
238 run-install: |
239 args:
240 - --filter=t3...
241
242 - name: Test WSL ABI auditor
243 run: node --test scripts/audit-wsl-native-abi.test.mjs
244
245 - name: Build node-pty and capture bundled Linux Node
246 shell: bash
247 run: |
248 set -euo pipefail
249 pty_pkg="$(node -e "console.log(require.resolve('node-pty/package.json', { paths: ['$GITHUB_WORKSPACE/apps/server'] }))")"
250 pty_dir="$(dirname "$pty_pkg")"
251 ( cd "$pty_dir" && npx --yes node-gyp@12.3.0 rebuild )
252 mkdir -p wsl-prebuild
253 cp "$pty_dir/build/Release/pty.node" wsl-prebuild/pty.node
254 cp -L "$(command -v node)" wsl-prebuild/node
255 chmod 0755 wsl-prebuild/node
256 file wsl-prebuild/pty.node wsl-prebuild/node
257
258 - name: Audit WSL native ABI floor
259 shell: bash
260 run: |
261 set -euo pipefail
262 libstdcxx="$(g++ -print-file-name=libstdc++.so.6)"
263 node scripts/audit-wsl-native-abi.mjs \
264 --baseline ubuntu-22.04 \
265 --arch x64 \
266 --max-glibc 2.35 \
267 --libstdcxx "$libstdcxx" \
268 --server-root apps/server \
269 --node-pty wsl-prebuild/pty.node \
270 --node-runtime wsl-prebuild/node \
271 --output wsl-prebuild/wsl-native-abi.json
272
273 - name: Smoke WSL native runtime on ABI floor
274 shell: bash
275 run: |
276 set -euo pipefail
277 wsl-prebuild/node scripts/smoke-wsl-native-runtime.mjs \
278 --server-root apps/server \
279 --arch x64 \
280 --node-pty wsl-prebuild/pty.node \
281 --node-runtime wsl-prebuild/node \
282 --manifest wsl-prebuild/wsl-native-abi.json
283
284 - name: Upload audited WSL runtime for Windows/WSL2 integration
285 uses: actions/upload-artifact@v7
286 with:
287 name: ci-wsl-native-runtime-x64
288 path: wsl-prebuild/
289 if-no-files-found: error
290 retention-days: 7
291
292 windows_wsl2_integration:
293 name: Windows + real WSL2 + Packaged Lifecycle
294 needs: [wsl_native_ci]
295 runs-on: windows-2025
296 timeout-minutes: 55
297 steps:
298 - name: Checkout
299 uses: actions/checkout@v6
300 with:
301 sparse-checkout: |
302 /*
303 !/.repos/
304 sparse-checkout-cone-mode: false
305
306 - name: Setup Vite+
307 uses: voidzero-dev/setup-vp@v1
308 with:
309 node-version-file: package.json
310 cache: true
311 run-install: |
312 args:
313 - --filter=@t3tools/desktop...
314 - --filter=t3...
315 - --filter=@t3tools/scripts...
316
317 - name: Setup Rust for packaged resource monitor
318 uses: dtolnay/rust-toolchain@stable
319 with:
320 components: rustfmt
321
322 - name: Download ABI-audited WSL runtime
323 uses: actions/download-artifact@v8
324 with:
325 name: ci-wsl-native-runtime-x64
326 path: wsl-prebuild
327
328 - name: Stage production node-pty marker into Windows workspace
329 run: node scripts/stage-wsl-ci-node-pty.mjs --server-root apps/server --runtime-dir wsl-prebuild --arch x64
330
331 - name: Install and initialize real WSL2 distros
332 shell: pwsh
333 run: ./scripts/bootstrap-wsl2-ci.ps1 -Distros Ubuntu-24.04,Debian
334
335 - name: Smoke audited native runtime inside each WSL2 distro
336 shell: pwsh
337 run: ./scripts/smoke-wsl2-native-runtime.ps1 -RuntimeDir ./wsl-prebuild -Distros Ubuntu-24.04,Debian
338
339 - name: Run desktop WSL integration against real wsl.exe
340 shell: pwsh
341 run: |
342 Push-Location apps/desktop
343 try {
344 vp test run src/wsl/DesktopWslEnvironment.windows.integration.test.ts --testTimeout=120000
345 } finally {
346 Pop-Location
347 }
348
349 - name: Build real portable Windows artifact with audited WSL runtime
350 shell: pwsh
351 run: |
352 $out = Join-Path $env:RUNNER_TEMP "t3code-packaged-smoke-dist"
353 New-Item -ItemType Directory -Force -Path $out | Out-Null
354 node scripts/build-desktop-artifact.ts `
355 --platform win `
356 --target portable `
357 --arch x64 `
358 --wsl-prebuild (Resolve-Path "wsl-prebuild/pty.node").Path `
359 --output-dir $out
360 "T3CODE_PACKAGED_SMOKE_ARTIFACT_DIR=$out" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
361
362 - name: Launch packaged Windows artifact through Windows + WSL lifecycle
363 shell: pwsh
364 run: ./scripts/run-windows-packaged-lifecycle-smoke.ps1 -ArtifactDir $env:T3CODE_PACKAGED_SMOKE_ARTIFACT_DIR -Distro Ubuntu-24.04 -TimeoutSeconds 300
365
366 - name: Upload packaged lifecycle receipt and logs
367 if: always()
368 uses: actions/upload-artifact@v7
369 with:
370 name: windows-packaged-lifecycle-smoke
371 path: |
372 ${{ runner.temp }}/T3 Code José QA/packaged lifecycle/receipt lifecycle.json
373 ${{ runner.temp }}/T3 Code José QA/packaged lifecycle/packaged stdout.log
374 ${{ runner.temp }}/T3 Code José QA/packaged lifecycle/packaged stderr.log
375 ${{ runner.temp }}/T3 Code José QA/packaged lifecycle/state home Ω/userdata/logs/**
376 if-no-files-found: ignore
377 retention-days: 14
378
379 - name: Capture WSL diagnostics
380 if: always()
381 shell: pwsh
382 run: |
383 $out = Join-Path $env:RUNNER_TEMP "t3code-wsl-ci-diagnostics.txt"
384 "=== wsl --version ===" | Out-File $out -Encoding utf8
385 (& wsl.exe --version 2>&1) | Out-File $out -Encoding utf8 -Append
386 "=== wsl --status ===" | Out-File $out -Encoding utf8 -Append
387 (& wsl.exe --status 2>&1) | Out-File $out -Encoding utf8 -Append
388 "=== wsl --list --verbose ===" | Out-File $out -Encoding utf8 -Append
389 (& wsl.exe --list --verbose 2>&1) | Out-File $out -Encoding utf8 -Append
390 foreach ($distro in @("Ubuntu-24.04", "Debian")) {
391 "=== $distro ===" | Out-File $out -Encoding utf8 -Append
392 (& wsl.exe --distribution $distro --user root -- /bin/sh -lc 'cat /etc/os-release; uname -a; getconf GNU_LIBC_VERSION 2>/dev/null || true; hostname -I' 2>&1) | Out-File $out -Encoding utf8 -Append
393 }
394 Get-Content $out
395
396 - name: Upload WSL diagnostics
397 if: always()
398 uses: actions/upload-artifact@v7
399 with:
400 name: windows-wsl2-diagnostics
401 path: ${{ runner.temp }}/t3code-wsl-ci-diagnostics.txt
402 if-no-files-found: ignore
403 retention-days: 14
404
405 - name: Shutdown WSL
406 if: always()
407 shell: pwsh
408 run: wsl.exe --shutdown
409
410 mobile_native_static_analysis:
411 name: Mobile Native Static Analysis
412 runs-on: blacksmith-6vcpu-macos-26
413 timeout-minutes: 10
414 steps:
415 - name: Checkout
416 uses: actions/checkout@v6
417 with:
418 sparse-checkout: |
419 /*
420 !/.repos/
421 sparse-checkout-cone-mode: false
422
423 - name: Setup Vite+
424 uses: voidzero-dev/setup-vp@v1
425 with:
426 node-version-file: package.json
427 cache: true
428 run-install: |
429 args:
430 - --filter=@t3tools/scripts...
431
432 - name: Install mobile native static analysis tools
433 run: brew bundle install --file apps/mobile/Brewfile
434
435 - name: Lint mobile native sources
436 run: vp run lint:mobile
437
438 release_smoke:
439 name: Release Smoke
440 runs-on: blacksmith-8vcpu-ubuntu-2404
441 timeout-minutes: 10
442 steps:
443 - name: Checkout
444 uses: actions/checkout@v6
445 with:
446 sparse-checkout: |
447 /*
448 !/.repos/
449 sparse-checkout-cone-mode: false
450
451 - name: Setup Vite+
452 uses: voidzero-dev/setup-vp@v1
453 with:
454 node-version-file: package.json
455 cache: true
456 run-install: |
457 args:
458 - --filter=@t3tools/scripts...
459
460 - name: Exercise release-only workflow steps
461 run: node scripts/release-smoke.ts