cicd-pipeline-skill について
cicd-pipeline-skillは、自動ビルドやテストを設定するチーム向けのCI/CDパイプライン資料です。GitHub Actions、Jenkins、GitLab CI、Azure DevOpsの例と参照情報を提供します。
主な機能
- 01GitHub Actionsのパイプラインパターン
- 02Jenkinsfileの例
- 03GitLab CIの設定例
- 04設定ファイルとシークレットの早見表
活用シーン
- 01自動テストパイプラインの構築
- 02該当するCI設定ファイルの確認
- 03CIシークレットの管理場所の確認
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ lambdatest/ agent-skills --skill cicd-pipeline-skillインストール後、Claude Code で/cicd-pipeline-skillを入力して読み込まれたか確認します。
同梱ファイルreference/playbook.md
詳細
CI/CD パイプラインスキル
コアパターン
GitHub Actions
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)
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: '[email protected]', subject: 'Tests Failed' }
}
}
GitLab CI
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
クイックリファレンス
| CI システム | 設定ファイル | シークレット |
|---|---|---|
| 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 |
高度なパターン
高度なパターン、デバッグガイド、CI/CD 連携、ベストプラクティスについては、
reference/playbook.md を参照してください。
コメント
Markdown 対応