بنقرة واحدة
ci-pipeline
Understanding and debugging CI/CD pipelines in this project
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Understanding and debugging CI/CD pipelines in this project
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Debug code using detailed profiling and critical path timing before making suggestions
Workflow for investigating and fixing failing tests in this project
Making Python or TypeScript packages shareable (pip/npm)
Setup pytest with coverage reporting and watch mode for this Python project
Commands to execute tests in this project with various options and configurations
Format code according to project standards and fix linting issues
| name | ci-pipeline |
| description | Understanding and debugging CI/CD pipelines in this project |
| auto-activates | ["CI pipeline","GitHub Actions","CI failing","workflow failing","pipeline error"] |
This skill activates when you need to:
Check for CI configuration files:
# GitHub Actions
.github/workflows/*.yml
# GitLab CI
.gitlab-ci.yml
# CircleCI
.circleci/config.yml
# Travis CI
.travis.yml
# Jenkins
Jenkinsfile
# Azure Pipelines
azure-pipelines.yml
GitHub Actions (via CLI):
# Install GitHub CLI if needed
# https://cli.github.com/
# List recent workflow runs
gh run list
# View specific run
gh run view <run-id>
# Watch a running workflow
gh run watch
GitHub Actions (via Web):
# .github/workflows/ci.yml example
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
# Install dependencies
- name: Lint
# Run linter
- name: Test
# Run tests
- name: Build
# Build project
Common stages:
Look at PR checks:
Click on failed check to see:
Pattern 1: Linting Failures
Error example:
Error: Format check failed
black --check . returned non-zero exit code
Fix:
# Run formatter locally
black .
# or
prettier --write .
# Commit and push
git add .
git commit -m "style: fix formatting"
git push
Pattern 2: Test Failures
Error example:
FAILED tests/test_user.py::test_login - AssertionError
Fix:
# Run tests locally
pytest tests/test_user.py::test_login -v
# Debug and fix
# Re-run all tests
pytest
# Commit fix
git add .
git commit -m "fix: resolve test failure in login"
git push
Pattern 3: Build Failures
Error example:
Error: Module not found: 'missing-package'
npm ERR! code ELIFECYCLE
Fix:
# Add missing dependency
npm install missing-package --save
# Or fix import
# Commit and push
git add package.json package-lock.json
git commit -m "fix: add missing dependency"
git push
Pattern 4: Timeout Errors
Error example:
Error: The job exceeded the maximum execution time
Fix:
# Increase timeout in workflow
jobs:
test:
timeout-minutes: 30 # Increase from default 360
Pattern 5: Environment Issues
Error example:
Error: Environment variable DATABASE_URL not set
Fix:
# Add secret/env var in workflow
jobs:
test:
env:
DATABASE_URL: postgresql://localhost/test
Or add in GitHub repository settings:
Download logs:
# GitHub Actions
gh run download <run-id>
# Or via web UI
# Click on failed step → View raw logs → Download
Key things to look for in logs:
Possible causes:
Solutions:
# Match local versions in CI
- uses: actions/setup-python@v4
with:
python-version: '3.10' # Match your local version
# Clear cache
- name: Clear pip cache
run: pip cache purge
# Set environment variables
env:
TZ: America/New_York
DATABASE_URL: ${{ secrets.DATABASE_URL }}
Cause: Different linter version or configuration
Solutions:
# Pin linter version
# requirements.txt
black==23.7.0
ruff==0.0.280
# package.json
"devDependencies": {
"prettier": "3.0.0",
"eslint": "8.44.0"
}
# Run same command as CI locally
npm run lint
black --check .
Cause: Environment-specific issues
Solutions:
GitHub Actions with act:
# Install act
brew install act # macOS
# or download from github.com/nektos/act
# Run workflow locally
act
# Run specific job
act -j test
# Run with secrets
act --secret-file .env.secrets
Pre-commit hooks (mimics CI):
# Install pre-commit
pip install pre-commit
# Install hooks
pre-commit install
# Run all hooks
pre-commit run --all-files
Add a new check:
# .github/workflows/ci.yml
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run security scan
run: |
pip install bandit
bandit -r src/
Add caching:
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
Matrix strategy (test multiple versions):
jobs:
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
name: PR Checks
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run build
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to production
run: ./deploy.sh
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish
run: npm publish
Solutions:
Solutions:
${{ secrets.SECRET_NAME }}Solutions:
on: triggers match your action# View runs
gh run list
gh run view <run-id>
# Re-run failed jobs
gh run rerun <run-id>
# Download logs
gh run download <run-id>
# Watch live
gh run watch
# On push to any branch
on: push
# On pull request
on: pull_request
# On push to specific branch
on:
push:
branches: [main, develop]
# On tag
on:
push:
tags: ['v*']
# On schedule (cron)
on:
schedule:
- cron: '0 0 * * *'