CI/CD Failures
This guide covers common CI/CD issues with GitHub Actions, testing, and builds.GitHub Actions Test Failures
Symptom: Tests pass locally but fail in CI Common Causes:1. Missing Test Dependencies
2. Timezone Differences
3. pytest-xdist Race Conditions
4. Environment Variable Differences
Docker Build Fails
Symptom:ERROR [internal] load metadata for docker.io/library/python:3.12-slim
Solutions:
1. Base Image Not Found
2. Build Context Too Large
3. Multi-stage Build Cache Issues
4. Out of Disk Space
Pre-commit Hook Failures
Symptom: Pre-commit hooks fail on specific files Common Issues:1. Ruff Formatting
2. MyPy Type Errors
3. Security Scanning (Bandit)
4. Hook Version Mismatch
Workflow Permission Errors
Symptom:Resource not accessible by integration or 403 Forbidden
Solutions:
1. Missing GITHUB_TOKEN Permissions
2. Missing Repository Secrets
3. Branch Protection Rules
Test Timeout Issues
Symptom: Tests timeout in CI but pass locally Solutions:1. Increase Timeout
2. Skip Slow Tests in CI
3. Use Faster Test Profile
Artifact Upload Failures
Symptom:Error: Unable to upload artifact
Solutions:
1. File Path Issues
2. Size Limits
Kustomize Build Errors in CI
Symptom:Error: accumulating resources in Kustomize validation
Solutions:
1. Validate Locally First
2. Check for Missing Files
3. Version Mismatch
Workflow Not Triggering
Symptom: Push/PR doesn’t trigger expected workflow Checklist:1. Check Trigger Conditions
2. Check Workflow Status
3. Verify Workflow File
Still Having Issues?
For advanced CI/CD troubleshooting:- Check Workflow Logs:
gh run view <run-id> --log - Debug Mode: Add
ACTIONS_RUNNER_DEBUG: trueto env - Review Documentation: See CI/CD Overview
- Search Issues: Check GitHub Issues