name: CI on: push: pull_request: permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: verify: name: typecheck + test + build (windows) runs-on: windows-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm # `npm ci` triggers electron's postinstall, which downloads the ~100MB # binary into %LOCALAPPDATA%\electron\Cache. Keyed on the lockfile so any # dependency bump — electron included — refetches instead of restoring a # binary that no longer matches the pinned version. - name: Cache Electron binary uses: actions/cache@v4 with: path: ~/AppData/Local/electron/Cache key: electron-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Install dependencies run: npm ci # npm test 会先自动跑 pretest(typecheck),再重建 esbuild bundle 并跑 13 个离线测试 - name: Test run: npm test # 仅验证构建通过;不做 electron-builder 打包、不发布、不传 artifact - name: Build run: npm run build