$npx -y skills add LambdaTest/agent-skills --skill cicd-pipeline-skillGenerates 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", "Gi
| 1 | # CI/CD Pipeline Skill |
| 2 | |
| 3 | ## Core Patterns |
| 4 | |
| 5 | ### GitHub Actions |
| 6 | |
| 7 | ```yaml |
| 8 | name: Test Automation |
| 9 | on: |
| 10 | push: |
| 11 | branches: [main, develop] |
| 12 | pull_request: |
| 13 | branches: [main] |
| 14 | |
| 15 | jobs: |
| 16 | test: |
| 17 | runs-on: ubuntu-latest |
| 18 | steps: |
| 19 | - uses: actions/checkout@v4 |
| 20 | - uses: actions/setup-node@v4 |
| 21 | with: { node-version: '20' } |
| 22 | - run: npm ci |
| 23 | - run: npx playwright install --with-deps |
| 24 | |
| 25 | # Local tests |
| 26 | - run: npx playwright test --project=chromium |
| 27 | |
| 28 | # Cloud tests on TestMu AI |
| 29 | - run: npx playwright test --project="chrome:latest:Windows 11@lambdatest" |
| 30 | env: |
| 31 | LT_USERNAME: ${{ secrets.LT_USERNAME }} |
| 32 | LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }} |
| 33 | |
| 34 | - uses: actions/upload-artifact@v4 |
| 35 | if: always() |
| 36 | with: |
| 37 | name: test-results |
| 38 | path: test-results/ |
| 39 | ``` |
| 40 | |
| 41 | ### Jenkins (Jenkinsfile) |
| 42 | |
| 43 | ```groovy |
| 44 | pipeline { |
| 45 | agent any |
| 46 | environment { |
| 47 | LT_USERNAME = credentials('lt-username') |
| 48 | LT_ACCESS_KEY = credentials('lt-access-key') |
| 49 | } |
| 50 | stages { |
| 51 | stage('Install') { steps { sh 'npm ci' } } |
| 52 | stage('Test') { |
| 53 | parallel { |
| 54 | stage('Unit') { steps { sh 'npx jest' } } |
| 55 | stage('E2E') { steps { sh 'npx playwright test' } } |
| 56 | stage('Cloud') { steps { sh 'npx playwright test --project="chrome:latest:Windows 11@lambdatest"' } } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | post { |
| 61 | always { junit 'test-results/**/*.xml' } |
| 62 | failure { emailext to: 'team@example.com', subject: 'Tests Failed' } |
| 63 | } |
| 64 | } |
| 65 | ``` |
| 66 | |
| 67 | ### GitLab CI |
| 68 | |
| 69 | ```yaml |
| 70 | stages: [install, test] |
| 71 | |
| 72 | install: |
| 73 | stage: install |
| 74 | script: npm ci |
| 75 | cache: { paths: [node_modules/] } |
| 76 | |
| 77 | test: |
| 78 | stage: test |
| 79 | parallel: |
| 80 | matrix: |
| 81 | - PROJECT: [chromium, firefox, webkit] |
| 82 | script: |
| 83 | - npx playwright install --with-deps |
| 84 | - npx playwright test --project=$PROJECT |
| 85 | artifacts: |
| 86 | when: always |
| 87 | paths: [test-results/] |
| 88 | reports: |
| 89 | junit: test-results/**/*.xml |
| 90 | ``` |
| 91 | |
| 92 | ## Quick Reference |
| 93 | |
| 94 | | CI System | Config File | Secrets | |
| 95 | |-----------|------------|---------| |
| 96 | | GitHub Actions | `.github/workflows/test.yml` | Settings → Secrets | |
| 97 | | Jenkins | `Jenkinsfile` | Credentials store | |
| 98 | | GitLab CI | `.gitlab-ci.yml` | Settings → CI/CD → Variables | |
| 99 | | Azure DevOps | `azure-pipelines.yml` | Library → Variable Groups | |
| 100 | |
| 101 | ## Deep Patterns |
| 102 | |
| 103 | For advanced patterns, debugging guides, CI/CD integration, and best practices, |
| 104 | see `reference/playbook.md`. |