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

ci.yml

133 lines4.5 KB

1name: CI
2​
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8​
9permissions:
10 contents: read
11 pull-requests: write
12​
13jobs:
14 quality:
15 name: Lint, Typecheck, Test, Build
16 runs-on: ubuntu-latest
17 steps:
18 - name: Checkout
19 uses: actions/checkout@v4
20​
21 - name: Setup Bun
22 uses: oven-sh/setup-bun@v2
23 with:
24 bun-version: 1.3.9
25​
26 - name: Cache Bun and Turbo
27 uses: actions/cache@v4
28 with:
29 path: |
30 ~/.bun/install/cache
31 .turbo
32 key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
33 restore-keys: |
34 ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
35​
36 - name: Install dependencies
37 run: bun install --frozen-lockfile
38​
39 - name: Lint
40 run: bun run lint
41​
42 - name: Typecheck
43 run: bun run typecheck
44​
45 - name: Test
46 run: bun run test
47​
48 - name: Build desktop pipeline
49 run: bun run build:desktop
50​
51 - name: Verify preload bundle output
52 run: |
53 test -f apps/desktop/dist-electron/preload.cjs
54 grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
55​
56 - name: Install desktop runtime deps (Linux)
57 if: runner.os == 'Linux'
58 run: |
59 sudo apt-get update
60 sudo apt-get install -y \
61 xvfb \
62 xauth \
63 libgtk-3-0 \
64 libnotify4 \
65 libnss3 \
66 libxss1 \
67 libxtst6 \
68 libatspi2.0-0 \
69 libdrm2 \
70 libgbm1 \
71 libxrandr2 \
72 libxshmfence1 \
73 libxi6 \
74 xdg-utils
75 sudo apt-get install -y libasound2t64 || sudo apt-get install -y libasound2
76​
77 - name: Desktop perf trace test
78 if: github.event_name != 'pull_request'
79 env:
80 ELECTRON_DISABLE_SANDBOX: "1"
81 T3CODE_PERF_TIMEOUT_MS: "420000"
82 T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
83 T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
84 T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
85 # Terminal PTY scripting is flaky in CI VMs; renderer perf checks remain enforced.
86 T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
87 # Keep only core renderer interactions in CI perf runs for lower variance.
88 T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
89 # Skip benchmark sweep loops in CI to reduce EventDispatch variance.
90 T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
91 # Keep benchmark follow-up passes disabled in CI by default.
92 T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
93 T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
94 run: xvfb-run -a bun run test:desktop-perf
95​
96 - name: Desktop perf trace test (fork PR)
97 if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
98 env:
99 ELECTRON_DISABLE_SANDBOX: "1"
100 T3CODE_PERF_TIMEOUT_MS: "420000"
101 T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
102 T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
103 T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
104 T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
105 T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
106 T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
107 T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
108 T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
109 run: xvfb-run -a bun run test:desktop-perf
110​
111 - name: Desktop perf trace test and PR summary
112 if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
113 env:
114 GH_TOKEN: ${{ github.token }}
115 ELECTRON_DISABLE_SANDBOX: "1"
116 T3CODE_PERF_TIMEOUT_MS: "420000"
117 T3CODE_PERF_MAX_KEYPRESS_AVG_MS: "12"
118 T3CODE_PERF_MAX_KEYPRESS_MAX_MS: "24"
119 T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
120 T3CODE_DESKTOP_PERF_RUN_TERMINAL: "0"
121 T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: "0"
122 T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: "0"
123 T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES: "0"
124 T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
125 run: xvfb-run -a bun run test:desktop-perf:post
126​
127 - name: Upload desktop perf artifacts
128 if: always()
129 uses: actions/upload-artifact@v4
130 with:
131 name: desktop-perf-artifacts
132 path: /tmp/t3code-perf-artifacts
133 if-no-files-found: ignore