forked from ChatLab/ChatLab
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (66 loc) · 2.3 KB
/
Copy pathtest.yml
File metadata and controls
85 lines (66 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
# 同一分支的旧运行自动取消,避免排队浪费
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
package-manager-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: packages/parser-native
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check workspace dependency declarations
run: pnpm run check:workspace-deps
# 共享 node_modules 的 better-sqlite3 由 pnpm install 保持 Node ABI
# (desktop 不再有 electron-rebuild postinstall),这里只需准备 CLI 专属副本。
- name: Prepare better-sqlite3 for Node tests
run: pnpm --filter chatlab-cli run ensure-native
- name: Build MCP package for workspace imports
run: pnpm --filter chatlab-mcp build
- name: Rust unit tests (parser-native)
working-directory: packages/parser-native
run: cargo test
# Debug 构建足够触发 TS 侧 parity 测试(native 缺失时这些测试会自动 skip,
# 构建后即可在 CI 上真实覆盖 Rust/TS 双路径一致性)。
- name: Build native parser (debug)
run: pnpm --filter @openchatlab/parser-native build:debug
- name: Unit & integration tests
run: pnpm test
- name: Type check (node)
run: pnpm run type-check:node