- Update CI verification step to check preload.cjs instead of preload.js, matching the tsdown CJS output format. - Add 10s grace period to bundle freshness check in dev-electron.mjs to avoid race condition when parallel processes write bundles before the script records its start time.
112 lines
3.2 KiB
YAML
112 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
quality:
|
|
name: Lint, Typecheck, Test, Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.9
|
|
|
|
- name: Cache Bun and Turbo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.bun/install/cache
|
|
.turbo
|
|
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: bun run lint
|
|
|
|
- name: Typecheck
|
|
run: bun run typecheck
|
|
|
|
- name: Test
|
|
run: bun run test
|
|
|
|
- name: Build desktop pipeline
|
|
run: bun run build:desktop
|
|
|
|
- name: Verify preload bundle output
|
|
run: |
|
|
test -f apps/desktop/dist-electron/preload.cjs
|
|
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
|
|
|
|
- name: Install desktop runtime deps (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
xvfb \
|
|
xauth \
|
|
libgtk-3-0 \
|
|
libnotify4 \
|
|
libnss3 \
|
|
libxss1 \
|
|
libxtst6 \
|
|
libatspi2.0-0 \
|
|
libdrm2 \
|
|
libgbm1 \
|
|
libxrandr2 \
|
|
libxshmfence1 \
|
|
libxi6 \
|
|
xdg-utils
|
|
sudo apt-get install -y libasound2t64 || sudo apt-get install -y libasound2
|
|
|
|
- name: Desktop perf trace test
|
|
if: github.event_name != 'pull_request'
|
|
env:
|
|
ELECTRON_DISABLE_SANDBOX: "1"
|
|
T3CODE_PERF_TIMEOUT_MS: "420000"
|
|
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
|
|
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
|
|
run: xvfb-run -a bun run test:desktop-perf
|
|
|
|
- name: Desktop perf trace test (fork PR)
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
|
env:
|
|
ELECTRON_DISABLE_SANDBOX: "1"
|
|
T3CODE_PERF_TIMEOUT_MS: "420000"
|
|
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
|
|
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
|
|
run: xvfb-run -a bun run test:desktop-perf
|
|
|
|
- name: Desktop perf trace test and PR summary
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
ELECTRON_DISABLE_SANDBOX: "1"
|
|
T3CODE_PERF_TIMEOUT_MS: "420000"
|
|
T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5"
|
|
T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000"
|
|
run: xvfb-run -a bun run test:desktop-perf:post
|
|
|
|
- name: Upload desktop perf artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: desktop-perf-artifacts
|
|
path: /tmp/t3code-perf-artifacts
|
|
if-no-files-found: ignore
|