名称: 跨平台测试矩阵 描述: 为 Windows、macOS 和 Linux 组合生成 CI 测试矩阵 允许使用的工具: Read, Write, Edit, Bash, Glob, Grep 标签: [测试, ci-cd, 跨平台, 矩阵, github-actions]
跨平台测试矩阵
为在 Windows、macOS 和 Linux 上测试桌面应用程序生成 CI/CD 测试矩阵配置。
能力
- 生成 GitHub Actions 矩阵
- 配置 Azure Pipelines 矩阵
- 设置平台特定测试
- 处理架构变体 (x64, arm64)
- 配置并行执行
- 设置工件收集
输入模式
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"ciPlatform": { "enum": ["github-actions", "azure-devops", "gitlab-ci"] },
"platforms": { "type": "array" },
"architectures": { "type": "array" }
},
"required": ["projectPath"]
}
GitHub Actions 矩阵
name: 测试矩阵
on: [push, pull_request]
jobs:
测试:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64]
include:
- os: macos-latest
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
architecture: ${{ matrix.arch }}
- name: 安装依赖
run: npm ci
- name: 运行测试
run: npm test
- name: 上传测试结果
uses: actions/upload-artifact@v4
if: always()
with:
name: 测试结果-${{ matrix.os }}-${{ matrix.arch }}
path: test-results/
相关技能
playwright-electron-configdesktop-ci-architect代理