testmu-ai/cicd-pipeline-skill
2026-10-22查看 2复制 0
为 GitHub Actions、Jenkins、GitLab CI 和 Azure DevOps 的测试生成 CI/CD 流水线。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md2988 chars
---
name: cicd-pipeline-skill
description: >
Generates CI/CD pipeline configurations for test automation with GitHub Actions,
Jenkins, GitLab CI, and Azure DevOps. Includes TestMu AI cloud integration.
Use when user mentions "CI/CD", "pipeline", "GitHub Actions", "Jenkins",
"GitLab CI". Triggers on: "CI/CD", "pipeline", "GitHub Actions", "Jenkins",
"GitLab CI", "Azure DevOps", "automated testing pipeline".
languages:
- YAML
category: devops
license: MIT
metadata:
author: TestMu AI
version: "1.0"
---
# CI/CD Pipeline Skill
## Core Patterns
### GitHub Actions
```yaml
name: Test Automation
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npx playwright install --with-deps
# Local tests
- run: npx playwright test --project=chromium
# Cloud tests on TestMu AI
- run: npx playwright test --project="chrome:latest:Windows 11@lambdatest"
env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
```
### Jenkins (Jenkinsfile)
```groovy
pipeline {
agent any
environment {
LT_USERNAME = credentials('lt-username')
LT_ACCESS_KEY = credentials('lt-access-key')
}
stages {
stage('Install') { steps { sh 'npm ci' } }
stage('Test') {
parallel {
stage('Unit') { steps { sh 'npx jest' } }
stage('E2E') { steps { sh 'npx playwright test' } }
stage('Cloud') { steps { sh 'npx playwright test --project="chrome:latest:Windows 11@lambdatest"' } }
}
}
}
post {
always { junit 'test-results/**/*.xml' }
failure { emailext to: 'team@example.com', subject: 'Tests Failed' }
}
}
```
### GitLab CI
```yaml
stages: [install, test]
install:
stage: install
script: npm ci
cache: { paths: [node_modules/] }
test:
stage: test
parallel:
matrix:
- PROJECT: [chromium, firefox, webkit]
script:
- npx playwright install --with-deps
- npx playwright test --project=$PROJECT
artifacts:
when: always
paths: [test-results/]
reports:
junit: test-results/**/*.xml
```
## Quick Reference
| CI System | Config File | Secrets |
|-----------|------------|---------|
| GitHub Actions | `.github/workflows/test.yml` | Settings → Secrets |
| Jenkins | `Jenkinsfile` | Credentials store |
| GitLab CI | `.gitlab-ci.yml` | Settings → CI/CD → Variables |
| Azure DevOps | `azure-pipelines.yml` | Library → Variable Groups |
## Deep Patterns
For advanced patterns, debugging guides, CI/CD integration, and best practices,
see `reference/playbook.md`.