Skip to content

Commit fcdd76a

Browse files
authored
Merge branch 'main' into t3/svg-attachments
2 parents 3b6f09c + 1eb4071 commit fcdd76a

410 files changed

Lines changed: 18438 additions & 4097 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/actions/setup-ci-deps/action.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Setup CI dependencies
22
description: Install Vite+ and the workspace dependencies from cache.
3+
inputs:
4+
task-cache-read-token:
5+
description: Read-only credential for the private maintainer task cache
6+
required: false
7+
default: ""
38
runs:
49
using: composite
510
steps:
@@ -65,3 +70,20 @@ runs:
6570
- name: Install dependencies
6671
shell: bash
6772
run: vp install
73+
74+
- name: Enable shared task cache
75+
if: >-
76+
github.repository == 'pingdotgg/t3code' &&
77+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
78+
hashFiles('.task-cache.json') != '' &&
79+
inputs.task-cache-read-token != ''
80+
shell: bash
81+
env:
82+
T3_TASK_CACHE_READ_TOKEN: ${{ inputs.task-cache-read-token }}
83+
run: |
84+
node infra/task-cache/scripts/install-ci.ts
85+
if [[ ( "$GITHUB_EVENT_NAME" == pull_request && "$GITHUB_BASE_REF" == main ) || ( "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main ) ]]; then
86+
echo 'VP_REMOTE_CACHE=read-write' >> "$GITHUB_ENV"
87+
else
88+
echo 'VP_REMOTE_CACHE=read' >> "$GITHUB_ENV"
89+
fi

‎.github/workflows/ci.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
# file, docs included. The `Check` job at the end of this file passes only
6060
# when every other job passes or was skipped by `changes`.
6161
lint:
62+
permissions:
63+
contents: read
64+
id-token: write
6265
name: Lint
6366
runs-on: blacksmith-8vcpu-ubuntu-2404
6467
timeout-minutes: 10
@@ -82,6 +85,8 @@ jobs:
8285
8386
- name: Setup Vite+
8487
uses: ./.github/actions/setup-ci-deps
88+
with:
89+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
8590

8691
# electron's install.js (run by ensure:electron) reads this cache before it
8792
# downloads from GitHub. The key changes only with the Electron version.
@@ -108,6 +113,9 @@ jobs:
108113
run: vp check
109114

110115
build:
116+
permissions:
117+
contents: read
118+
id-token: write
111119
name: Build and Typecheck
112120
needs: changes
113121
if: ${{ !cancelled() && (needs.changes.outputs.build != 'false' || needs.changes.outputs.typecheck != 'false') }}
@@ -139,6 +147,8 @@ jobs:
139147
140148
- name: Setup Vite+
141149
uses: ./.github/actions/setup-ci-deps
150+
with:
151+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
142152

143153
# electron's install.js (run by ensure:electron) reads this cache before it
144154
# downloads from GitHub. The key changes only with the Electron version.
@@ -197,6 +207,9 @@ jobs:
197207
# dependency layers. The concurrency limit stays at the default 4 so peak load
198208
# per runner is unchanged.
199209
test:
210+
permissions:
211+
contents: read
212+
id-token: write
200213
name: Test
201214
needs: changes
202215
if: ${{ !cancelled() && needs.changes.outputs.test != 'false' }}
@@ -237,6 +250,8 @@ jobs:
237250
238251
- name: Setup Vite+
239252
uses: ./.github/actions/setup-ci-deps
253+
with:
254+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
240255

241256
# electron's install.js (run by ensure:electron) reads this cache before it
242257
# downloads from GitHub. The key changes only with the Electron version.
@@ -278,6 +293,9 @@ jobs:
278293
# started last and ran alone for about 40s after everything else finished.
279294
# release.yml mirrors this test, test_web, and test_server split.
280295
test_web:
296+
permissions:
297+
contents: read
298+
id-token: write
281299
name: Test Web
282300
needs: changes
283301
if: ${{ !cancelled() && needs.changes.outputs.test_web != 'false' }}
@@ -295,6 +313,8 @@ jobs:
295313

296314
- name: Setup Vite+
297315
uses: ./.github/actions/setup-ci-deps
316+
with:
317+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
298318

299319
# The browser project runs React tests in headless Chromium. Same cache key as
300320
# test_server, so both jobs share one downloaded browser.
@@ -333,6 +353,9 @@ jobs:
333353
# The shards are the longest jobs, so they gate themselves instead of waiting
334354
# ~15s for `changes`: a shard the change cannot affect stops after checkout.
335355
test_server:
356+
permissions:
357+
contents: read
358+
id-token: write
336359
name: Test Server ${{ matrix.shard }}
337360
runs-on: blacksmith-4vcpu-ubuntu-2404
338361
timeout-minutes: 10
@@ -359,6 +382,8 @@ jobs:
359382
- name: Setup Vite+
360383
if: steps.changes.outputs.test_server != 'false'
361384
uses: ./.github/actions/setup-ci-deps
385+
with:
386+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
362387

363388
# No Electron setup here: `t3` (apps/server) has no Electron dependency
364389
# and none of its tests touch the runtime. Only the non-server `test`
@@ -495,6 +520,9 @@ jobs:
495520
run: vp run lint:mobile
496521

497522
release_smoke:
523+
permissions:
524+
contents: read
525+
id-token: write
498526
name: Release Smoke
499527
needs: changes
500528
if: ${{ !cancelled() && needs.changes.outputs.release_smoke != 'false' }}
@@ -512,6 +540,8 @@ jobs:
512540

513541
- name: Setup Vite+
514542
uses: ./.github/actions/setup-ci-deps
543+
with:
544+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
515545

516546
- name: Exercise release-only workflow steps
517547
run: node scripts/release-smoke.ts

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ jobs:
131131

132132
- name: Setup dependencies
133133
uses: ./.github/actions/setup-ci-deps
134+
with:
135+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
134136
env:
135137
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
136138

@@ -245,6 +247,8 @@ jobs:
245247

246248
- name: Setup dependencies
247249
uses: ./.github/actions/setup-ci-deps
250+
with:
251+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
248252

249253
- name: Ensure Electron runtime is installed
250254
run: vp run --filter @t3tools/desktop ensure:electron
@@ -275,6 +279,8 @@ jobs:
275279

276280
- name: Setup dependencies
277281
uses: ./.github/actions/setup-ci-deps
282+
with:
283+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
278284

279285
- name: Ensure Electron runtime is installed
280286
run: vp run --filter @t3tools/desktop ensure:electron
@@ -309,6 +315,8 @@ jobs:
309315

310316
- name: Setup dependencies
311317
uses: ./.github/actions/setup-ci-deps
318+
with:
319+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
312320

313321
- name: Resolve Playwright version
314322
id: playwright_version
@@ -359,6 +367,8 @@ jobs:
359367

360368
- name: Setup dependencies
361369
uses: ./.github/actions/setup-ci-deps
370+
with:
371+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
362372

363373
# No Electron setup here: `t3` (apps/server) has no Electron dependency
364374
# and none of its tests touch the runtime. Only the non-server `test`

‎.task-cache.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"endpoint": "https://t3-task-cache.pinglabs.workers.dev/projects/t3code"
3+
}

0 commit comments

Comments
 (0)