This directory contains the Continuous Integration and Continuous Deployment (CI/CD) workflows for the Asset Report CLI application.
- Overview
- Workflow Structure
- Naming Conventions
- Jobs Description
- Triggers and Conditions
- Environment Configuration
- Artifacts and Reports
- Maintenance and Updates
The CI/CD pipeline for Asset Report CLI is designed following modern DevOps practices with a focus on:
- Quality Assurance: Multi-stage testing and code quality checks
- Security: Automated vulnerability scanning and security analysis
- Performance: Basic performance profiling and memory usage monitoring
- Deployment Readiness: Automated artifact creation and validation
This comprehensive workflow handles the complete CI/CD pipeline for the Asset Report CLI application located in apps/asset_report_cli/.
- Format:
{application-name}-{purpose}.yml - Example:
asset-report-cli-ci.yml - Purpose: Clear identification of application and workflow type
- Format:
{purpose}-{type}(kebab-case) - Examples:
code-quality- Code quality analysisunit-tests- Unit testingintegration-tests- Integration testingsecurity-scan- Security analysisbuild-validation- Build and documentation validationperformance-tests- Performance testingdeployment-check- Deployment readiness
- Format:
{application-name}-{type}-{identifier} - Examples:
asset-report-cli-deployment-{github.sha}security-reportstest-results
- main: Production-ready code, triggers full CI/CD pipeline
- develop: Development branch, triggers CI pipeline
- feature/*: Feature branches, triggers CI on PR to main
Purpose: Ensures code meets quality standards and formatting conventions
Tools Used:
- Black: Python code formatter
- isort: Import statement organizer
- Flake8: Python linting and style checking
- Pylint: Advanced static analysis
- MyPy: Static type checking
Success Criteria:
- All code passes Black formatting checks
- Import statements are properly organized
- No critical Flake8 violations (E9, F63, F7, F82)
- Pylint score above threshold
- Type hints are properly defined
Purpose: Validates individual components functionality
Strategy:
- Matrix Testing: Python versions 3.10, 3.11, 3.12
- Coverage Analysis: Measures test coverage using coverage.py
- Parallel Execution: Tests run across multiple Python versions simultaneously
Reports Generated:
- Coverage report with missing lines
- XML coverage report for external tools
- JUnit-style test results
Purpose: Validates component interactions and CLI functionality
Scope:
- End-to-end workflow testing
- CLI interface validation
- Template processing verification
- CSV processing integration
Dependencies: Requires unit-tests to pass
Purpose: Identifies security vulnerabilities and dependency issues
Tools Used:
- Safety: Checks Python dependencies for known vulnerabilities
- Bandit: Python security linter for common security issues
- Semgrep: Static analysis for security patterns
Outputs:
- JSON security reports
- Vulnerability summaries
- Actionable security recommendations
Purpose: Ensures application can be properly built and documented
Validations:
- Python package structure verification
- Import dependency resolution
- README.md presence and validity
- Template file existence and structure
Dependencies: Requires code-quality and unit-tests to pass
Purpose: Basic performance monitoring and memory profiling
Scope:
- Memory usage profiling
- Import time measurement
- Basic performance benchmarks
Trigger: Only on main branch pushes
Dependencies: Requires integration-tests to pass
Purpose: Final validation and artifact creation for deployment
Activities:
- Comprehensive status check
- Deployment package creation
- Artifact uploading with versioning
Trigger: Only on main branch Dependencies: All previous jobs must pass
The workflow is optimized to run only when relevant files change:
paths:
- 'apps/asset_report_cli/**'
- '.github/workflows/asset-report-cli-ci.yml'- Push Events:
main,developbranches - Pull Request Events: Only to
mainbranch - Conditional Jobs: Some jobs only run on specific branches
graph TD
A[code-quality] --> D[build-validation]
B[unit-tests] --> C[integration-tests]
B --> D
C --> E[performance-tests]
A --> F[deployment-check]
B --> F
C --> F
G[security-scan] --> F
D --> F
- Primary: Python 3.12 (latest stable)
- Matrix Testing: 3.10, 3.11, 3.12 (broad compatibility)
- Deployment Target: Python 3.12
- Core Dependencies:
pandas(as specified in requirements.txt) - Development Dependencies: Installed per job requirements
- Caching Strategy: pip cache with matrix-aware keys
All jobs operate within ./apps/asset_report_cli to maintain isolation.
- Location:
security-reportsartifact - Contents:
safety-report.json- Dependency vulnerability scanbandit-report.json- Code security analysis
- Retention: 90 days (default)
- Format: XML and console output
- Integration: Codecov for external reporting
- Threshold: Configurable per project needs
- Name:
asset-report-cli-deployment-{github.sha} - Contents: Complete application with dependencies
- Retention: 30 days
- Format: Ready-to-deploy archive
-
Weekly:
- Review security scan results
- Update dependency versions if needed
- Check for GitHub Actions updates
-
Monthly:
- Update Python versions in matrix if new releases
- Review and update security tool versions
- Analyze performance trends
-
Quarterly:
- Review and update CI/CD strategy
- Evaluate new tools and integrations
- Update documentation
Update the matrix in unit-tests job when new Python versions are released:
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13'] # Add new versionsKeep action versions updated for security and features:
- uses: actions/checkout@v4 # Update to latest
- uses: actions/setup-python@v4 # Update to latestRegularly update security scanning tools:
pip install safety bandit semgrep --upgrade-
Code Quality Failures:
- Run
black .locally to fix formatting - Run
isort .to fix import organization - Review Flake8 and Pylint suggestions
- Run
-
Test Failures:
- Check test logs for specific failures
- Verify local test environment matches CI
- Review dependency compatibility
-
Security Scan Issues:
- Review security reports in artifacts
- Update vulnerable dependencies
- Add security exceptions if needed
-
Slow CI Runs:
- Review caching strategy
- Optimize job dependencies
- Consider parallel execution
-
Resource Constraints:
- Monitor job execution times
- Optimize test data size
- Consider runner upgrades
When contributing improvements to the CI/CD pipeline:
- Test Changes: Test workflow changes in a fork first
- Documentation: Update this README for any significant changes
- Backward Compatibility: Ensure changes don't break existing functionality
- Security: Review security implications of any changes
For CI/CD related issues:
- Create GitHub issues with
ci/cdlabel - Include workflow run links and error logs
- Tag relevant maintainers for urgent issues
Last Updated: July 16, 2025 Workflow Version: 1.0.0 Maintainer: Asset Report CLI Team