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