Skip to content

Commit 0c53149

Browse files
Merge branch 'main' into feat/settle-running-thread
2 parents 0fdf7c9 + 5cc99e1 commit 0c53149

72 files changed

Lines changed: 3931 additions & 361 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 157 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ concurrency:
1414
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1515

1616
jobs:
17-
check:
18-
name: Check
17+
# Lint, typecheck, and the desktop build each get a runner so they run side by
18+
# side instead of one after another. The `Check` job at the end of this file
19+
# passes only when every other job does.
20+
lint:
21+
name: Lint
1922
runs-on: blacksmith-8vcpu-ubuntu-2404
2023
timeout-minutes: 10
2124
steps:
@@ -52,27 +55,86 @@ jobs:
5255
- name: Check
5356
run: vp check
5457

58+
typecheck:
59+
name: Typecheck
60+
runs-on: blacksmith-8vcpu-ubuntu-2404
61+
timeout-minutes: 10
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v6
65+
with:
66+
sparse-checkout: |
67+
/*
68+
!/.repos/
69+
sparse-checkout-cone-mode: false
70+
71+
- name: Setup Vite+
72+
uses: voidzero-dev/setup-vp@v1
73+
with:
74+
node-version-file: package.json
75+
cache: true
76+
run-install: true
77+
78+
- name: Ensure Electron runtime is installed
79+
run: vp run --filter @t3tools/desktop ensure:electron
80+
5581
- name: Typecheck
5682
run: vpr typecheck
5783

84+
build:
85+
name: Build
86+
runs-on: blacksmith-8vcpu-ubuntu-2404
87+
timeout-minutes: 10
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v6
91+
with:
92+
sparse-checkout: |
93+
/*
94+
!/.repos/
95+
sparse-checkout-cone-mode: false
96+
5897
- uses: ./.github/actions/setup-apt-mirrors
5998

60-
- name: Install browser secret helper build libraries
99+
# Runs in the background while Vite+ installs; the step before the build waits for it.
100+
- name: Start installing browser secret helper build libraries
61101
run: |
62102
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
63-
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
103+
(
104+
set +e
105+
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
106+
echo "$?" > "$RUNNER_TEMP/apt-status"
107+
) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
108+
109+
- name: Setup Vite+
110+
uses: voidzero-dev/setup-vp@v1
111+
with:
112+
node-version-file: package.json
113+
cache: true
114+
run-install: true
115+
116+
- name: Ensure Electron runtime is installed
117+
run: vp run --filter @t3tools/desktop ensure:electron
118+
119+
- name: Finish installing browser secret helper build libraries
120+
timeout-minutes: 5
121+
run: |
122+
until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
123+
cat "$RUNNER_TEMP/apt.log"
124+
exit "$(cat "$RUNNER_TEMP/apt-status")"
64125
65126
- name: Build desktop pipeline
66127
run: vp run build:desktop
67128

68129
- name: Verify preload bundle output
69130
run: node apps/desktop/scripts/verify-preload-bundle.mjs
70131

71-
# Everything except `t3` (apps/server). `--parallel` drops the package
72-
# dependency ordering that `vp run` applies by default: these `test` tasks
73-
# declare no `dependsOn` and resolve workspace deps from source, so ordering
74-
# only bought us idle runners between dependency layers. The concurrency
75-
# limit stays at the default 4 so peak load per runner is unchanged.
132+
# Everything except `t3` (apps/server) and the web app, which has its own job
133+
# below. `--parallel` drops the package dependency ordering that `vp run`
134+
# applies by default: these `test` tasks declare no `dependsOn` and resolve
135+
# workspace deps from source, so ordering only bought us idle runners between
136+
# dependency layers. The concurrency limit stays at the default 4 so peak load
137+
# per runner is unchanged.
76138
test:
77139
name: Test
78140
runs-on: blacksmith-8vcpu-ubuntu-2404
@@ -86,6 +148,19 @@ jobs:
86148
!/.repos/
87149
sparse-checkout-cone-mode: false
88150

151+
- uses: ./.github/actions/setup-apt-mirrors
152+
153+
# The desktop tests compile the browser secret helper. The install runs in
154+
# the background while Vite+ installs; the step before the tests waits for it.
155+
- name: Start installing browser secret helper build libraries
156+
run: |
157+
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
158+
(
159+
set +e
160+
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
161+
echo "$?" > "$RUNNER_TEMP/apt-status"
162+
) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
163+
89164
- name: Setup Vite+
90165
uses: voidzero-dev/setup-vp@v1
91166
with:
@@ -96,34 +171,61 @@ jobs:
96171
- name: Ensure Electron runtime is installed
97172
run: vp run --filter @t3tools/desktop ensure:electron
98173

99-
- uses: ./.github/actions/setup-apt-mirrors
100-
101-
- name: Install browser secret helper build libraries
102-
run: |
103-
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
104-
sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
105-
106174
- name: Test preview artifact validation
107175
run: python3 -B .github/scripts/stage-preview-bundle.test.py
108176

109177
- name: Test nightly release checks
110178
run: node --test .github/scripts/check-nightly-release.test.cjs
111179

180+
- name: Finish installing browser secret helper build libraries
181+
timeout-minutes: 5
182+
run: |
183+
until test -s "$RUNNER_TEMP/apt-status"; do sleep 1; done
184+
cat "$RUNNER_TEMP/apt.log"
185+
exit "$(cat "$RUNNER_TEMP/apt-status")"
186+
187+
- name: Test
188+
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' --filter '!@t3tools/web' test
189+
190+
# The web suite is the largest outside the server. In the shared Test job it
191+
# started last and ran alone for about 40s after everything else finished.
192+
test_web:
193+
name: Test Web
194+
runs-on: blacksmith-8vcpu-ubuntu-2404
195+
timeout-minutes: 10
196+
steps:
197+
- name: Checkout
198+
uses: actions/checkout@v6
199+
with:
200+
sparse-checkout: |
201+
/*
202+
!/.repos/
203+
sparse-checkout-cone-mode: false
204+
205+
- name: Setup Vite+
206+
uses: voidzero-dev/setup-vp@v1
207+
with:
208+
node-version-file: package.json
209+
cache: true
210+
run-install: true
211+
112212
- name: Test
113-
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
213+
run: vp run --filter @t3tools/web test
114214

115-
# apps/server sets `fileParallelism: false`, so its 239 files run strictly
215+
# apps/server sets `fileParallelism: false`, so its test files run strictly
116216
# one at a time. Sharding spreads them over separate runners instead of
117217
# separate workers, so no two server test files ever share a machine and the
118-
# isolation that flag buys is preserved exactly.
218+
# isolation that flag buys is preserved exactly. One file at a time keeps
219+
# about 1.5 cores busy, so 4 vCPU runners lose nothing against 8. The shards
220+
# split files by recorded duration (apps/server/src/testUtils/weightedShardSequencer.ts).
119221
test_server:
120222
name: Test Server ${{ matrix.shard }}
121-
runs-on: blacksmith-8vcpu-ubuntu-2404
223+
runs-on: blacksmith-4vcpu-ubuntu-2404
122224
timeout-minutes: 10
123225
strategy:
124226
fail-fast: false
125227
matrix:
126-
shard: [1, 2, 3]
228+
shard: [1, 2, 3, 4, 5, 6]
127229
steps:
128230
- name: Checkout
129231
uses: actions/checkout@v6
@@ -347,3 +449,37 @@ jobs:
347449
348450
- name: Exercise release-only workflow steps
349451
run: node scripts/release-smoke.ts
452+
453+
# Branch protection requires this job by its name, `Check`. It fails when any
454+
# other job fails, is cancelled, or is skipped without a reason, so splitting
455+
# or resharding jobs needs no ruleset change. Add every new job to `needs`.
456+
# `always()` rather than `!cancelled()`: a skipped job reports success to
457+
# branch protection, so a cancelled run must still produce a failing check.
458+
check:
459+
name: Check
460+
if: ${{ always() }}
461+
needs:
462+
[
463+
lint,
464+
typecheck,
465+
build,
466+
test,
467+
test_web,
468+
test_server,
469+
rust,
470+
mobile_native_changes,
471+
mobile_native_static_analysis,
472+
release_smoke,
473+
]
474+
runs-on: blacksmith-2vcpu-ubuntu-2404
475+
timeout-minutes: 5
476+
steps:
477+
- name: Require every job to pass
478+
env:
479+
RESULTS: ${{ toJSON(needs) }}
480+
run: |
481+
echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"'
482+
# Only the macOS lint skips on purpose, when no native mobile code changed.
483+
echo "$RESULTS" | jq -e 'all(to_entries[];
484+
.value.result == "success"
485+
or (.key == "mobile_native_static_analysis" and .value.result == "skipped"))' > /dev/null

‎.github/workflows/desktop-macos-preview-publish.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ jobs:
284284
concurrency:
285285
group: desktop-macos-preview-${{ needs.resolve.outputs.pr_number }}-build
286286
cancel-in-progress: true
287+
# release-desktop.yml asks for actions: read (its Windows builds list artifacts).
288+
permissions:
289+
actions: read
290+
contents: read
287291
uses: ./.github/workflows/release-desktop.yml
288292
secrets:
289293
CSC_LINK: ${{ secrets.CSC_LINK }}

0 commit comments

Comments
 (0)