This directory contains the CI/CD pipeline configuration for the DHT Crawler project.
The CI/CD pipeline provides automated building, testing, code quality checks, security scanning, and deployment for the DHT Crawler project.
- Platforms: Ubuntu, macOS, Windows
- Compilers: GCC, Clang, MSVC
- Build Types: Release, Debug
- Testing: Unit tests, Integration tests, Performance tests
- Formatting: clang-format
- Static Analysis: cppcheck, clang-tidy
- Code Coverage: Coverage reports
- Documentation: Doxygen generation
- Vulnerability Scanning: Trivy
- Dependency Scanning: Security audit
- SAST: Static Application Security Testing
- Benchmarks: Performance benchmarks
- Memory Analysis: Valgrind
- Profiling: Performance profiling
- Migration Testing: Database migration tests
- Integration Testing: Database integration tests
- Performance Testing: Database performance tests
- Release Building: Automated release builds
- Package Creation: Release packages
- GitHub Releases: Automated GitHub releases
Main CI/CD workflow that runs on:
- Push to main/develop branches
- Pull requests to main/develop branches
- Release creation
- Multi-platform builds (Ubuntu, macOS, Windows)
- Multi-compiler support (GCC, Clang, MSVC)
- Automated testing
- Code quality checks
- Security scanning
- Performance testing
- Database testing
- Automated deployment
CI-specific Dockerfile for building and testing:
- Ubuntu 22.04 base image
- All development dependencies
- Build tools and compilers
- Testing frameworks
- Code quality tools
Test environment with:
- MySQL database
- DHT Crawler application
- Performance testing
- Database migration testing
CI/CD setup and execution script:
- Environment setup
- Dependency installation
- Docker configuration
- Build execution
- Test execution
- Code quality checks
- Security scanning
- Performance analysis
- Database testing
- Report generation
# Set up CI/CD environment
./scripts/ci_setup.sh --setup
# Run all CI/CD steps
./scripts/ci_setup.sh --all
# Run specific steps
./scripts/ci_setup.sh --build --test --quality
The pipeline runs automatically on:
- Push to main/develop branches
- Pull requests
- Release creation
# Run tests with Docker
docker-compose -f docker-compose.test.yml up --build
# Run specific tests
docker-compose -f docker-compose.test.yml run --rm dht_crawler
BUILD_TYPE
: Build type (Release/Debug)CMAKE_BUILD_TYPE
: CMake build typeCC
: C compilerCXX
: C++ compiler
- CMake build system
- Multi-platform support
- Parallel builds
- Optimized builds
- Google Test framework
- Coverage reporting
- Performance testing
- Integration testing
- GitHub Actions status badges
- Build notifications
- Test result reporting
- Build time tracking
- Test execution time
- Performance benchmarks
- Resource usage
- Code coverage
- Static analysis results
- Security scan results
- Performance metrics
-
Build Failures
- Check compiler compatibility
- Verify dependency versions
- Check build configuration
-
Test Failures
- Check test environment
- Verify database connectivity
- Check test data
-
Quality Check Failures
- Fix code formatting issues
- Address static analysis warnings
- Improve code coverage
-
Security Scan Failures
- Update vulnerable dependencies
- Fix security issues
- Review security policies
-
Local Debugging
# Run with debug output ./scripts/ci_setup.sh --build --test --verbose # Run specific tests ctest --test-dir build --output-on-failure -R specific_test
-
Docker Debugging
# Run with debug output docker-compose -f docker-compose.test.yml up --build --verbose # Access container shell docker-compose -f docker-compose.test.yml exec dht_crawler bash
-
GitHub Actions Debugging
- Check workflow logs
- Review build artifacts
- Check environment variables
- Write comprehensive tests
- Follow coding standards
- Use proper error handling
- Document code changes
- Test all code paths
- Use realistic test data
- Test edge cases
- Performance test critical paths
- Regular dependency updates
- Security scan integration
- Secure coding practices
- Vulnerability management
- Regular performance testing
- Monitor resource usage
- Optimize critical paths
- Performance regression testing
For CI/CD issues:
- Check the workflow logs
- Review the configuration
- Test locally first
- Check dependencies
- Review documentation
When contributing to CI/CD:
- Test changes locally
- Update documentation
- Follow best practices
- Review security implications
- Test on multiple platforms