File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ permissions:
1313 pull-requests : write # 如果需要评论 PR
1414
1515jobs :
16- test :
16+ # ==========================================
17+ # Job 1: PowerShell Pester 测试
18+ # ==========================================
19+ pester-test :
1720 name : Run Pester on ${{ matrix.os }}
1821 runs-on : ${{ matrix.os }}
1922 strategy :
3538 with :
3639 name : Pester Tests (${{ matrix.os }})
3740 path : testResults.xml
38- reporter : dotnet-nunit
41+ reporter : dotnet-nunit
42+ # ==========================================
43+ # Job 2: Node.js Vitest 测试 (新增部分)
44+ # ==========================================
45+ node-test :
46+ name : Node Vitest (Ubuntu)
47+ runs-on : ubuntu-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+
51+ # 1. 安装 pnpm
52+ - name : Install pnpm
53+ uses : pnpm/action-setup@v4
54+ with :
55+ version : 10 # 指定你使用的 pnpm 版本
56+
57+ # 2. 安装 Node 并开启 pnpm 缓存 (这是 Monorepo 速度的关键)
58+ - name : Setup Node
59+ uses : actions/setup-node@v4
60+ with :
61+ node-version : 24
62+ cache : ' pnpm'
63+
64+ # 3. 安装依赖
65+ - name : Install Dependencies
66+ run : pnpm install --frozen-lockfile
67+
68+ # 4. 运行 Vitest 并生成报告
69+ # 注意:你需要配置 Vitest 输出 JUnit 格式的 XML
70+ - name : Run Vitest
71+ run : |
72+ pnpm exec vitest run --reporter=junit --outputFile=vitest-report.xml
73+
74+ # 5. 上传 Vitest 报告
75+ - name : Report Vitest
76+ uses : dorny/test-reporter@v2
77+ if : success() || failure()
78+ with :
79+ name : Vitest Results
80+ path : vitest-report.xml
81+ reporter : java-junit # Vitest 的 JUnit 输出对应 java-junit 解析器
82+ fail-on-error : false
You can’t perform that action at this time.
0 commit comments