Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ci.yml

671 lines26.9 KB

1name: CI
2​
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8​
9permissions:
10 contents: read
11​
12concurrency:
13 group: ci-${{ github.event.pull_request.number || github.sha }}
14 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15​
16jobs:
17 # Skips jobs a pull request cannot affect: a web change does not run the
18 # server shards, a server change does not run the mobile tests, and the macOS
19 # lint (~6.7x a Linux minute) runs only for native mobile sources.
20 # .github/scripts/ci-changes.cjs maps changed files to workspace packages and
21 # their dependents. Pushes to main still run every Linux job. Detection fails
22 # open: if the diff cannot be resolved, everything runs.
23 changes:
24 name: Changes
25 runs-on: blacksmith-2vcpu-ubuntu-2404
26 timeout-minutes: 5
27 outputs:
28 typecheck: ${{ steps.detect.outputs.typecheck }}
29 build: ${{ steps.detect.outputs.build }}
30 desktop_launch: ${{ steps.detect.outputs.desktop_launch }}
31 test: ${{ steps.detect.outputs.test }}
32 test_packages: ${{ steps.detect.outputs.test_packages }}
33 test_web: ${{ steps.detect.outputs.test_web }}
34 test_server: ${{ steps.detect.outputs.test_server }}
35 rust: ${{ steps.detect.outputs.rust }}
36 release_smoke: ${{ steps.detect.outputs.release_smoke }}
37 mobile_native: ${{ steps.detect.outputs.mobile_native }}
38 steps:
39 # Only the package manifests the script reads to build the dependency graph.
40 # Depth 2 brings the base commit the change is diffed against.
41 - name: Checkout
42 uses: actions/checkout@v6
43 with:
44 fetch-depth: 2
45 sparse-checkout: |
46 /pnpm-workspace.yaml
47 /.github/scripts/ci-changes.cjs
48 /.github/actions/ci-changes/
49 /*/package.json
50 /*/*/package.json
51 !/.repos/
52 sparse-checkout-cone-mode: false
53​
54 - name: Detect affected jobs
55 id: detect
56 uses: ./.github/actions/ci-changes
57​
58 # Lint and the desktop build each get a runner so they run side by side.
59 # Typecheck shares the build's install. Lint always runs: it formats every
60 # file, docs included. The `Check` job at the end of this file passes only
61 # when every other job passes or was skipped by `changes`.
62 lint:
63 permissions:
64 contents: read
65 id-token: write
66 name: Lint
67 runs-on: blacksmith-8vcpu-ubuntu-2404
68 timeout-minutes: 10
69 steps:
70 - name: Checkout
71 uses: actions/checkout@v6
72 with:
73 sparse-checkout: |
74 /*
75 !/.repos/
76 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
77 sparse-checkout-cone-mode: false
78​
79 - name: Reject repository-owned PR assets
80 run: |
81 files="$(git ls-files .github/pr-assets)"
82 if test -n "$files"; then
83 printf 'PR evidence must be uploaded to GitHub, not committed:\n%s\n' "$files" >&2
84 exit 1
85 fi
86​
87 - name: Setup Vite+
88 uses: ./.github/actions/setup-ci-deps
89 with:
90 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
91​
92 # electron's install.js (run by ensure:electron) reads this cache before it
93 # downloads from GitHub. The key changes only with the Electron version.
94 - name: Cache Electron download
95 uses: actions/cache@v6
96 with:
97 path: ~/.cache/electron
98 key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
99​
100 - name: Ensure Electron runtime is installed
101 run: vp run --filter @t3tools/desktop ensure:electron
102​
103 # Files/dependencies are repo-wide; export checks cover clean workspaces only.
104 - name: Check unused code
105 run: vp run knip:check
106​
107 - name: Check generated GitHub GraphQL operations
108 run: vp run --filter @t3tools/source-control-github generate --check
109​
110 - name: Check generated Expo GraphQL operations
111 run: vp run --filter t3 generate --check
112​
113 - name: Check
114 run: vp check
115​
116 build:
117 permissions:
118 contents: read
119 id-token: write
120 name: Build and Typecheck
121 needs: changes
122 if: ${{ !cancelled() && (needs.changes.outputs.build != 'false' || needs.changes.outputs.typecheck != 'false') }}
123 runs-on: blacksmith-8vcpu-ubuntu-2404
124 timeout-minutes: 10
125 steps:
126 - name: Checkout
127 uses: actions/checkout@v6
128 with:
129 sparse-checkout: |
130 /*
131 !/.repos/
132 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
133 sparse-checkout-cone-mode: false
134​
135 - uses: ./.github/actions/setup-apt-mirrors
136 if: needs.changes.outputs.build != 'false'
137​
138 # Runs in the background while Vite+ installs; the step before the build waits for it.
139 # Xvfb is for the desktop launch check below.
140 - name: Start installing browser secret helper build libraries
141 if: needs.changes.outputs.build != 'false'
142 run: |
143 # Fetch only the indexes these main and universe packages need. The full set is ~42 MB,
144 # which a slow mirror can stretch past the wait below.
145 sudo sed -i -e 's|http://|https://|g' -e 's/^Components: .*/Components: main universe/' \
146 /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
147 (
148 set +e
149 sudo apt-get update -o Acquire::Languages=none \
150 -o Acquire::IndexTargets::deb::DEP-11::DefaultEnabled=false \
151 -o Acquire::IndexTargets::deb::CNF::DefaultEnabled=false &&
152 sudo apt-get install -y libsecret-1-dev pkg-config xvfb
153 echo "$?" > "$RUNNER_TEMP/apt-status"
154 ) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
155​
156 - name: Setup Vite+
157 uses: ./.github/actions/setup-ci-deps
158 with:
159 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
160​
161 # electron's install.js (run by ensure:electron) reads this cache before it
162 # downloads from GitHub. The key changes only with the Electron version.
163 - name: Cache Electron download
164 uses: actions/cache@v6
165 with:
166 path: ~/.cache/electron
167 key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
168​
169 - name: Ensure Electron runtime is installed
170 id: electron
171 run: vp run --filter @t3tools/desktop ensure:electron
172​
173 # Runs in the background while the build runs, and reports in the last
174 # step: neither result hides the other.
175 - name: Start typecheck
176 id: typecheck
177 if: ${{ !cancelled() && steps.electron.outcome == 'success' && needs.changes.outputs.typecheck != 'false' }}
178 run: |
179 (
180 set +e
181 vpr typecheck
182 echo "$?" > "$RUNNER_TEMP/typecheck-status"
183 ) > "$RUNNER_TEMP/typecheck.log" 2>&1 < /dev/null &
184​
185 - name: Finish installing browser secret helper build libraries
186 id: apt
187 if: ${{ !cancelled() && needs.changes.outputs.build != 'false' }}
188 timeout-minutes: 5
189 run: |
190 until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
191 cat "$RUNNER_TEMP/apt.log"
192 exit "$(cat "$RUNNER_TEMP/apt-status")"
193​
194 - name: Build desktop pipeline
195 id: build
196 if: ${{ !cancelled() && steps.electron.outcome == 'success' && steps.apt.outcome == 'success' && needs.changes.outputs.build != 'false' }}
197 run: vp run build:desktop
198​
199 - name: Verify preload bundle output
200 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
201 run: node apps/desktop/scripts/verify-preload-bundle.mjs
202​
203 # The release launch check, run unpackaged against the same old-state fixture, for
204 # startup and sidebar changes. Packaging and signing stay release-only.
205 - name: Open the seeded thread in the built desktop app
206 id: desktop_launch
207 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.desktop_launch != 'false' }}
208 timeout-minutes: 4
209 run: |
210 electron=$(node -p "require('./apps/desktop/node_modules/electron')")
211 xvfb-run -a node scripts/smoke-desktop-app.ts --executable "$electron" --app apps/desktop \
212 --artifacts-dir "$RUNNER_TEMP/desktop-launch-check"
213​
214 - name: Upload desktop launch check
215 if: ${{ failure() && steps.desktop_launch.outcome == 'failure' }}
216 uses: actions/upload-artifact@v7
217 with:
218 name: desktop-launch-check
219 path: ${{ runner.temp }}/desktop-launch-check
220 if-no-files-found: ignore
221​
222 # Browser tests run source modules; this boots the production chunk graph. The
223 # desktop build above already produced apps/web/dist, and the client waits about
224 # 15s for a session that never comes, so this runs here instead of in Test Web,
225 # which gates the whole run. Chromium comes from the cache Test Web shares.
226 - name: Resolve Playwright version
227 id: playwright_version
228 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
229 run: echo "version=$(node -p "require('./apps/web/node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
230​
231 - name: Cache Chromium
232 id: chromium_cache
233 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
234 uses: actions/cache@v6
235 with:
236 path: ~/.cache/ms-playwright
237 key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
238​
239 - name: Install Chromium for the built web client boot check
240 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' && steps.chromium_cache.outputs.cache-hit != 'true' }}
241 run: node apps/web/node_modules/playwright/cli.js install --only-shell chromium
242​
243 - name: Install missing Chromium system dependencies
244 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
245 run: |
246 browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
247 test -n "$browser"
248 if ldd "$browser" | grep '=> not found'; then
249 node apps/web/node_modules/playwright/cli.js install-deps chromium
250 fi
251​
252 - name: Boot the built web client
253 if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
254 timeout-minutes: 3
255 run: node apps/web/scripts/verify-built-boot.ts
256​
257 - name: Typecheck
258 if: ${{ !cancelled() && steps.typecheck.outcome == 'success' }}
259 timeout-minutes: 5
260 run: |
261 until test -s "$RUNNER_TEMP/typecheck-status"; do sleep 1; done
262 cat "$RUNNER_TEMP/typecheck.log"
263 exit "$(cat "$RUNNER_TEMP/typecheck-status")"
264​
265 # Everything except `t3` (apps/server) and the web app, which has its own job
266 # below. `--parallel` drops the package dependency ordering that `vp run`
267 # applies by default: these `test` tasks declare no `dependsOn` and resolve
268 # workspace deps from source, so ordering only bought us idle runners between
269 # dependency layers. The concurrency limit stays at the default 4 so peak load
270 # per runner is unchanged.
271 test:
272 permissions:
273 contents: read
274 id-token: write
275 name: Test
276 needs: changes
277 if: ${{ !cancelled() && needs.changes.outputs.test != 'false' }}
278 runs-on: blacksmith-8vcpu-ubuntu-2404
279 timeout-minutes: 10
280 steps:
281 - name: Checkout
282 uses: actions/checkout@v6
283 with:
284 sparse-checkout: |
285 /*
286 !/.repos/
287 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
288 sparse-checkout-cone-mode: false
289​
290 - uses: ./.github/actions/setup-apt-mirrors
291​
292 # The desktop tests compile the browser secret helper. The install runs in
293 # the background while Vite+ installs; the step before the tests waits for it.
294 - name: Start installing browser secret helper build libraries
295 run: |
296 # Fetch only the indexes these main and universe packages need. The full set is ~42 MB,
297 # which a slow mirror can stretch past the wait below.
298 sudo sed -i -e 's|http://|https://|g' -e 's/^Components: .*/Components: main universe/' \
299 /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
300 (
301 set +e
302 sudo apt-get update -o Acquire::Languages=none \
303 -o Acquire::IndexTargets::deb::DEP-11::DefaultEnabled=false \
304 -o Acquire::IndexTargets::deb::CNF::DefaultEnabled=false &&
305 sudo apt-get install -y libsecret-1-dev pkg-config
306 echo "$?" > "$RUNNER_TEMP/apt-status"
307 ) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
308​
309 - name: Setup Vite+
310 uses: ./.github/actions/setup-ci-deps
311 with:
312 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
313​
314 # electron's install.js (run by ensure:electron) reads this cache before it
315 # downloads from GitHub. The key changes only with the Electron version.
316 - name: Cache Electron download
317 uses: actions/cache@v6
318 with:
319 path: ~/.cache/electron
320 key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
321​
322 - name: Ensure Electron runtime is installed
323 run: vp run --filter @t3tools/desktop ensure:electron
324​
325 - name: Test preview artifact validation
326 run: python3 -B .github/scripts/stage-preview-bundle.test.py
327​
328 - name: Test release checks
329 run: node --test .github/scripts/check-nightly-release.test.cjs .github/scripts/vercel-deployment-output.test.cjs .github/scripts/mobile-preview-comment.test.cjs
330​
331 - name: Finish installing browser secret helper build libraries
332 timeout-minutes: 5
333 run: |
334 until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
335 cat "$RUNNER_TEMP/apt.log"
336 exit "$(cat "$RUNNER_TEMP/apt-status")"
337​
338 # `changes` lists the affected packages, or nothing when all of them are.
339 - name: Test
340 env:
341 TEST_PACKAGES: ${{ needs.changes.outputs.test_packages }}
342 run: |
343 set -o pipefail
344 filters=(--filter '!t3' --filter '!@t3tools/monorepo' --filter '!@t3tools/web')
345 if [[ -n "$TEST_PACKAGES" ]]; then
346 filters=()
347 for package in $TEST_PACKAGES; do filters+=(--filter "$package"); done
348 fi
349 # The runner's trace writer can crash on surrogate pairs in test output.
350 vp run --parallel --concurrency-limit 4 "${filters[@]}" test 2>&1 | python3 -u -c '
351 import sys
352 for line in sys.stdin:
353 sys.stdout.write(line.encode("ascii", "backslashreplace").decode("ascii"))
354 '
355​
356 # The web suite is the largest outside the server. In the shared Test job it
357 # started last and ran alone for about 40s after everything else finished.
358 # release.yml mirrors this test, test_web, and test_server split.
359 test_web:
360 permissions:
361 contents: read
362 id-token: write
363 name: Test Web
364 needs: changes
365 if: ${{ !cancelled() && needs.changes.outputs.test_web != 'false' }}
366 runs-on: blacksmith-8vcpu-ubuntu-2404
367 timeout-minutes: 10
368 steps:
369 - name: Checkout
370 uses: actions/checkout@v6
371 with:
372 sparse-checkout: |
373 /*
374 !/.repos/
375 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
376 sparse-checkout-cone-mode: false
377​
378 - name: Setup Vite+
379 uses: ./.github/actions/setup-ci-deps
380 with:
381 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
382​
383 # The browser project runs React tests in headless Chromium. Same cache key as
384 # test_server, so both jobs share one downloaded browser.
385 - name: Resolve Playwright version
386 id: playwright_version
387 run: echo "version=$(node -p "require('./apps/web/node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
388​
389 - name: Cache Chromium
390 id: chromium_cache
391 uses: actions/cache@v6
392 with:
393 path: ~/.cache/ms-playwright
394 key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
395​
396 - name: Install Chromium for web browser tests
397 if: steps.chromium_cache.outputs.cache-hit != 'true'
398 run: node apps/web/node_modules/playwright/cli.js install --only-shell chromium
399​
400 - name: Install missing Chromium system dependencies
401 run: |
402 browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
403 test -n "$browser"
404 if ldd "$browser" | grep '=> not found'; then
405 node apps/web/node_modules/playwright/cli.js install-deps chromium
406 fi
407​
408 - name: Test
409 run: vp run --filter @t3tools/web test
410​
411 # apps/server sets `fileParallelism: false`, so its test files run strictly
412 # one at a time. Sharding spreads them over separate runners instead of
413 # separate workers, so no two server test files ever share a machine and the
414 # isolation that flag buys is preserved exactly. One file at a time keeps
415 # about 1.5 cores busy, so 4 vCPU runners lose nothing against 8. The shards
416 # split files by recorded duration (apps/server/src/testUtils/weightedShardSequencer.ts).
417 # The shards are the longest jobs, so they gate themselves instead of waiting
418 # ~15s for `changes`: a shard the change cannot affect stops after checkout.
419 test_server:
420 permissions:
421 contents: read
422 id-token: write
423 name: Test Server ${{ matrix.shard }}
424 runs-on: blacksmith-4vcpu-ubuntu-2404
425 # Shards take 2-5 minutes. When the shared task cache throttles reads, each
426 # failed fetch stalls vp for 15-90s, which pushed shards past 10 minutes.
427 timeout-minutes: 20
428 strategy:
429 fail-fast: false
430 matrix:
431 shard: [1, 2, 3, 4, 5, 6, 7, 8]
432 steps:
433 # Depth 2 brings the base commit the change is diffed against.
434 - name: Checkout
435 uses: actions/checkout@v6
436 with:
437 fetch-depth: 2
438 sparse-checkout: |
439 /*
440 !/.repos/
441 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
442 sparse-checkout-cone-mode: false
443​
444 - name: Detect affected jobs
445 id: changes
446 uses: ./.github/actions/ci-changes
447​
448 - name: Setup Vite+
449 if: steps.changes.outputs.test_server != 'false'
450 uses: ./.github/actions/setup-ci-deps
451 with:
452 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
453​
454 # No Electron setup here: `t3` (apps/server) has no Electron dependency
455 # and none of its tests touch the runtime. Only the non-server `test`
456 # job, which covers @t3tools/desktop, needs the download.
457 # Cache the pinned browser and skip apt unless shared libraries are missing.
458 - name: Resolve Playwright version
459 id: playwright_version
460 if: steps.changes.outputs.test_server != 'false'
461 run: echo "version=$(node -p "require('./apps/server/node_modules/playwright-core/package.json').version")" >> "$GITHUB_OUTPUT"
462​
463 - name: Cache Chromium
464 id: chromium_cache
465 if: steps.changes.outputs.test_server != 'false'
466 uses: actions/cache@v6
467 with:
468 path: ~/.cache/ms-playwright
469 key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
470​
471 - name: Install Chromium for server browser integration tests
472 if: steps.changes.outputs.test_server != 'false' && steps.chromium_cache.outputs.cache-hit != 'true'
473 run: node apps/server/node_modules/playwright-core/cli.js install --only-shell chromium
474​
475 - name: Install missing Chromium system dependencies
476 if: steps.changes.outputs.test_server != 'false'
477 run: |
478 browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
479 test -n "$browser"
480 if ldd "$browser" | grep '=> not found'; then
481 node apps/server/node_modules/playwright-core/cli.js install-deps chromium
482 fi
483​
484 - name: Test
485 if: steps.changes.outputs.test_server != 'false'
486 env:
487 T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
488 T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
489 run: >-
490 vp run test:cached -- --shard ${{ matrix.shard }}/${{ strategy.job-total }}
491 --uncached apps/server/integration/transferBudgetV2.integration.test.ts
492 --verify-hits 1 --report "${{ runner.temp }}/test-cache-${{ matrix.shard }}.json" apps/server
493​
494 - name: Upload test cache measurements
495 if: always() && steps.changes.outputs.test_server != 'false'
496 uses: actions/upload-artifact@v7
497 with:
498 name: test-cache-${{ matrix.shard }}
499 path: ${{ runner.temp }}/test-cache-${{ matrix.shard }}.json
500 if-no-files-found: error
501​
502 # integration/transferBudgetV2.integration.test.ts writes the report; exactly one shard
503 # produces these files. Gating the upload on their presence keeps a
504 # single `thread-transfer-results` artifact per run, which is the name
505 # thread-transfer-report.yml resolves.
506 - name: Detect transfer budget report
507 id: transfer_budget
508 if: always()
509 run: |
510 if test -f "${{ runner.temp }}/thread-transfer-result.json"; then
511 echo "present=true" >> "$GITHUB_OUTPUT"
512 else
513 echo "present=false" >> "$GITHUB_OUTPUT"
514 fi
515​
516 - name: Publish transfer budget report
517 if: always() && steps.transfer_budget.outputs.present == 'true'
518 run: |
519 if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
520 tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
521 else
522 echo "Transfer budget report was not produced." >> "$GITHUB_STEP_SUMMARY"
523 fi
524​
525 - name: Upload thread transfer result
526 if: always() && steps.transfer_budget.outputs.present == 'true'
527 uses: actions/upload-artifact@v7
528 with:
529 name: thread-transfer-results
530 path: ${{ runner.temp }}/thread-transfer-result.json
531 if-no-files-found: ignore
532 retention-days: 30
533​
534 # Split out of Check and Test: both paid ~7-9s to install a Rust toolchain
535 # for checks that take under 3s, on the critical path of every PR.
536 rust:
537 name: Rust
538 needs: changes
539 if: ${{ !cancelled() && needs.changes.outputs.rust != 'false' }}
540 runs-on: blacksmith-4vcpu-ubuntu-2404
541 timeout-minutes: 10
542 steps:
543 - name: Checkout
544 uses: actions/checkout@v6
545 with:
546 sparse-checkout: |
547 /*
548 !/.repos/
549 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
550 sparse-checkout-cone-mode: false
551​
552 - name: Setup Rust
553 uses: dtolnay/rust-toolchain@stable
554 with:
555 components: rustfmt
556​
557 - name: Check Rust formatting
558 run: |
559 for crate in resource-monitor kde-snap-shot hyprland-snap-shot; do
560 cargo fmt --manifest-path "native/$crate/Cargo.toml" -- --check
561 done
562​
563 - name: Test Rust crates
564 run: |
565 for crate in resource-monitor kde-snap-shot hyprland-snap-shot; do
566 cargo test --locked --manifest-path "native/$crate/Cargo.toml"
567 done
568​
569 mobile_native_static_analysis:
570 name: Mobile Native Static Analysis
571 needs: changes
572 if: ${{ !cancelled() && needs.changes.outputs.mobile_native != 'false' }}
573 runs-on: blacksmith-6vcpu-macos-26
574 timeout-minutes: 10
575 steps:
576 - name: Checkout
577 uses: actions/checkout@v6
578 with:
579 sparse-checkout: |
580 /*
581 !/.repos/
582 sparse-checkout-cone-mode: false
583​
584 - name: Setup Vite+
585 uses: voidzero-dev/setup-vp@v1
586 with:
587 node-version-file: package.json
588 cache: true
589 run-install: |
590 args:
591 - --filter=@t3tools/scripts...
592​
593 - name: Install mobile native static analysis tools
594 run: brew bundle install --file apps/mobile/Brewfile
595​
596 - name: Lint mobile native sources
597 run: vp run lint:mobile
598​
599 release_smoke:
600 permissions:
601 contents: read
602 id-token: write
603 name: Release Smoke
604 needs: changes
605 if: ${{ !cancelled() && needs.changes.outputs.release_smoke != 'false' }}
606 runs-on: blacksmith-8vcpu-ubuntu-2404
607 timeout-minutes: 15
608 steps:
609 - name: Checkout
610 uses: actions/checkout@v6
611 with:
612 sparse-checkout: |
613 /*
614 !/.repos/
615 !/apps/mobile/modules/t3-terminal/Vendor/**/*.a
616 sparse-checkout-cone-mode: false
617​
618 - name: Setup Vite+
619 uses: ./.github/actions/setup-ci-deps
620 with:
621 task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
622​
623 - name: Exercise release-only workflow steps
624 run: node scripts/release-smoke.ts
625​
626 # Branch protection requires this job by its name, `Check`. It fails when any
627 # other job fails, is cancelled, or is skipped without a reason, so splitting
628 # or resharding jobs needs no ruleset change. Add every new job to `needs`.
629 # `always()` rather than `!cancelled()`: a skipped job reports success to
630 # branch protection, so a cancelled run must still produce a failing check.
631 check:
632 name: Check
633 if: ${{ always() }}
634 needs:
635 [
636 changes,
637 lint,
638 build,
639 test,
640 test_web,
641 test_server,
642 rust,
643 mobile_native_static_analysis,
644 release_smoke,
645 ]
646 runs-on: blacksmith-2vcpu-ubuntu-2404
647 timeout-minutes: 5
648 steps:
649 - name: Require every job to pass
650 env:
651 RESULTS: ${{ toJSON(needs) }}
652 run: |
653 echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"'
654 # A job may skip only when `changes` said every gate it represents was
655 # not needed. Gates are keyed by job name, except merged Build and the
656 # macOS lint.
657 echo "$RESULTS" | jq -e '.changes.outputs as $gates
658 | {build: ["build", "typecheck", "desktop_launch"], mobile_native_static_analysis: ["mobile_native"]} as $renamed
659 | all(to_entries[];
660 .value.result == "success"
661 or (.value.result == "skipped"
662 and (($renamed[.key] // [.key]) | all(.[]; $gates[.] == "false"))))' > /dev/null
663​
664 # thread-transfer-report.yml reads this artifact after CI, so a run whose
665 # server tests ran must have produced it.
666 - name: Require transfer measurements
667 if: needs.test_server.result == 'success' && needs.changes.outputs.test_server != 'false'
668 uses: actions/download-artifact@v8
669 with:
670 name: thread-transfer-results
671 path: ${{ runner.temp }}/thread-transfer