From ddccd0f9700af9402f4d888e473b37b11d0ce327 Mon Sep 17 00:00:00 2001 From: buxuku Date: Wed, 8 Jul 2026 13:41:18 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=85=B3=E9=97=AD=E9=9D=9E=20main=20?= =?UTF-8?q?=E5=88=86=E6=94=AF=20Vercel=20=E8=87=AA=E5=8A=A8=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E5=B9=B6=E6=96=B0=E5=A2=9E=20CI=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=20(#373)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - vercel.json / docs/vercel.json:git.deploymentEnabled 仅放行 main, fork PR 不再触发预览部署,消除挂死的 "Authorization required to deploy" 检查 - 新增 .github/workflows/ci.yml:PR 与 main push 上运行 i18n 门禁、 五组纯逻辑单测(engines/parser/structured-output/cancel/dubbing)、 应用编译(nextron --no-pack)与 Docusaurus 文档构建,均不依赖 secrets --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ docs/vercel.json | 13 +++++++ vercel.json | 13 +++++++ 3 files changed, 101 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 docs/vercel.json create mode 100644 vercel.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..17f1d0f7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + app: + name: App checks (i18n / unit tests / build) + runs-on: ubuntu-22.04 + timeout-minutes: 30 + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.14.0 + cache: yarn + + # CI=true 时 postinstall 的 ensure-native 会自动跳过原生依赖下载; + # yarn build(--no-pack)不依赖 addon.node / sherpa 原生库,无需 fetch。 + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Check i18n key parity + run: yarn check:i18n + + - name: Unit tests (engines) + run: yarn test:engines + + - name: Unit tests (AI response parser) + run: yarn test:translate-parser + + - name: Unit tests (structured output fallback) + run: yarn test:structured-output + + - name: Unit tests (translation cancel) + run: yarn test:translation-cancel + + - name: Unit tests (dubbing) + run: yarn test:dubbing + + - name: Compile application (renderer + main) + run: yarn build + + docs: + name: Docs build (Docusaurus) + runs-on: ubuntu-22.04 + timeout-minutes: 15 + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.14.0 + cache: yarn + cache-dependency-path: docs/yarn.lock + + - name: Install docs dependencies + working-directory: docs + run: yarn install --frozen-lockfile + + - name: Build docs site + working-directory: docs + run: yarn build diff --git a/docs/vercel.json b/docs/vercel.json new file mode 100644 index 00000000..0cac1b4a --- /dev/null +++ b/docs/vercel.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "git": { + "deploymentEnabled": { + "main": true, + "*": false, + "**": false + } + }, + "github": { + "silent": true + } +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..0cac1b4a --- /dev/null +++ b/vercel.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "git": { + "deploymentEnabled": { + "main": true, + "*": false, + "**": false + } + }, + "github": { + "silent": true + } +}