DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(ci): gate native checks behind shared pre-job (#1070)
Hairy399b1a8d25df
diff --git a/.github/workflows/ci-native.yml b/.github/workflows/ci-native.ymldeleted file mode 100644index 53a600b5..00000000--- a/.github/workflows/ci-native.yml+++ /dev/null@@ -1,35 +0,0 @@-name: Native CI--on:- push:- branches: [main]- pull_request:- branches: [main, native]--permissions:- contents: read--concurrency:- group: ${{ github.workflow }}-${{ github.ref }}- cancel-in-progress: true--jobs:- native:- name: Native typecheck and unit tests- runs-on: ubuntu-latest- timeout-minutes: 10- steps:- - name: Checkout repository- uses: actions/checkout@v7-- - name: Setup Node.js and pnpm- uses: ./.github/actions/setup-node-pnpm-- - name: Install dependencies- run: pnpm install --frozen-lockfile-- - name: Type check native subproject- run: pnpm run typecheck:native-- - name: Native unit test- run: pnpm run test:nativediff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 21dd7471..7a9a3dd4 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -40,6 +40,28 @@ jobs:skip_after_successful_duplicate: truepaths_ignore: '["**/docs/**", "**/*.md"]'+ native:+ name: Native typecheck and unit tests+ needs: pre_job+ if: ${{ needs.pre_job.outputs.should_skip != 'true' }}+ runs-on: ubuntu-latest+ timeout-minutes: 10+ steps:+ - name: Checkout repository+ uses: actions/checkout@v7++ - name: Setup Node.js and pnpm+ uses: ./.github/actions/setup-node-pnpm++ - name: Install dependencies+ run: pnpm install --frozen-lockfile++ - name: Type check native subproject+ run: pnpm run typecheck:native++ - name: Native unit test+ run: pnpm run test:native+# 单元测试(vitest)+ 类型检查 + lint:unit:name: Unit Tests (vitest)diff --git a/test/native-ci-workflow.test.ts b/test/native-ci-workflow.test.tsnew file mode 100644index 00000000..1a044730--- /dev/null+++ b/test/native-ci-workflow.test.ts@@ -0,0 +1,13 @@+import { existsSync } from 'node:fs'+import { expect, it } from 'vitest'+import { readSource } from './setup/read-source'++it('native checks use the shared pre-job gate instead of an independent workflow', () => {+ const source = readSource('.github/workflows/ci.yml')+ const native = source.match(/^ {2}native:\n([\s\S]*?)(?=^ {2}[\w-]+:|(?![\s\S]))/m)?.[1]+ expect(native).toContain('needs: pre_job')+ expect(native).toMatch(/^ {4}if: \$\{\{ needs\.pre_job\.outputs\.should_skip != 'true' \}\}$/m)+ expect(native).toContain('run: pnpm run typecheck:native')+ expect(native).toContain('run: pnpm run test:native')+ expect(existsSync(new URL('../.github/workflows/ci-native.yml', import.meta.url))).toBe(false)+})