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

ci.yml

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