Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

180 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Actions Workflows for UTF Strings

This directory contains comprehensive CI/CD workflows for the UTF Strings C++23 library, ensuring cross-platform compatibility, security, and performance.

πŸ“ Note: As of November 2025, the standalone cppcheck-analysis.yml and semgrep-security.yml workflows have been consolidated into the comprehensive sast-scanning.yml workflow for better reliability and unified security reporting.

Workflow Overview

πŸ”„ ci.yml - Main CI/CD Pipeline

Triggers: Push, Pull Request, Release Purpose: Primary continuous integration pipeline

Jobs:

  • Linux GCC 13 (x64): Debug + Release builds, tests, benchmarks
  • Linux Clang 18 (x64): Debug + Release builds, tests, benchmarks
  • Windows MSVC 2022 & Clang-CL (x64): Debug + Release builds, tests, benchmarks
  • Linux Fuzz Testing: libFuzzer with all UTF encodings (UTF-8/16/32 BE/LE)
  • Linux Sanitizers: AddressSanitizer + ThreadSanitizer (GCC & Clang)
  • Windows Sanitizers: AddressSanitizer (MSVC & Clang-CL)
  • Performance Tracking: Baseline performance monitoring
  • Test Results Publishing: Unified test result reporting
  • Documentation Artifacts: Generates combined docs for GitHub Pages

Features:

  • βœ… Cross-platform builds (Linux GCC/Clang, Windows MSVC/Clang-CL)
  • βœ… Comprehensive testing (unit tests, fuzz tests, sanitizers)
  • βœ… Performance benchmarking with tracking
  • βœ… Code formatting validation (clang-format)
  • βœ… Artifact collection and reporting

�️ sast-scanning.yml - Comprehensive SAST Security Scanning

Triggers: Push, Pull Request, Daily Schedule (4 AM UTC), Manual Dispatch Purpose: Comprehensive Static Application Security Testing (SAST) with multiple security tools

Jobs:

  • Trivy Scan: Vulnerability and misconfiguration detection
  • Checkov Scan: Infrastructure as Code security analysis
  • Gitleaks Scan: Secret detection in git history
  • Cppcheck Analysis: C/C++ static code analysis
  • Semgrep Analysis: Security pattern matching and vulnerability detection
  • SAST Summary: Comprehensive reporting and artifact management

Features:

  • βœ… Integrated security tools - All tools run directly in one workflow
  • βœ… Configurable scan intensity - Basic, Comprehensive, Deep scanning levels
  • βœ… SARIF integration - All results uploaded to GitHub Security/Code Scanning tab
  • βœ… No external dependencies - No PAT tokens or workflow dispatch permissions needed
  • βœ… Comprehensive reporting - Unified summary with detailed artifact management
  • βœ… PR integration - Automatic security scan results in pull request comments

Security Tools Coverage:

  • Trivy (trivy-security): Container vulnerabilities, OS packages, misconfigurations
  • Checkov (checkov-infrastructure): GitHub Actions, Dockerfile, YAML/JSON security
  • Gitleaks (gitleaks-secrets): Full git history secret detection
  • Cppcheck (cppcheck-static-analysis): C++ static analysis with configurable severity
  • Semgrep (semgrep-security): Security patterns and vulnerability detection

Scan Intensity Levels:

  • Basic: Error-level issues only (fast)
  • Comprehensive (default): Warning + error issues (balanced)
  • Deep: All issue types including style and performance (thorough)

οΏ½πŸ”’ codeql.yml - Advanced Security Analysis

Triggers: Push, Pull Request, Release, Weekly Schedule Purpose: Advanced semantic security analysis using GitHub CodeQL

Jobs:

  • CodeQL Analysis: Linux x64 Clang Release build analysis
  • Enhanced Security Analysis: Additional security tools for releases

Features:

  • βœ… CodeQL scanning with security-extended queries
  • βœ… Release security validation (clang-tidy, valgrind)
  • βœ… Custom query configuration for C++ security patterns
  • βœ… Binary security analysis (stack protection, ASLR, PIE, NX bit)
  • βœ… SARIF results uploaded to GitHub Security tab

Security Checks:

  • Buffer overflow detection (CWE-119, CWE-120)
  • Integer overflow detection (CWE-190)
  • Use-after-free detection (CWE-416)
  • Out-of-bounds access (CWE-787, CWE-788)

πŸ“„ pages-deploy.yml - GitHub Pages Deployment

Triggers: CI Workflow Completion, Manual Dispatch Purpose: Dedicated GitHub Pages deployment with explicit Jekyll disable

Jobs:

  • Deploy Documentation: Deploys combined documentation to GitHub Pages

Features:

  • βœ… Isolated deployment - Separate from main CI for reliability
  • βœ… Jekyll disabled - Explicit .nojekyll file creation and Jekyll file cleanup
  • βœ… Artifact management - Downloads docs from CI workflow completion
  • βœ… Static site optimization - Removes Jekyll conflicts and sets proper permissions
  • βœ… Deployment verification - Comprehensive validation and reporting

🏷️ create-release.yml - Automated Release Creation

Triggers: Version Tags (v*.*.*), Manual Dispatch with Version Input Purpose: Automated GitHub release creation with cross-platform binary distribution

Jobs:

  • Build Release Binaries: Multi-platform builds for Linux and Windows
  • Create GitHub Release: Automated release with downloadable assets

Platform Matrix:

  • Linux GCC 13 (x64): Release + Debug binaries (.tar.gz)
  • Linux Clang 18 (x64): Release + Debug binaries (.tar.gz)
  • Windows MSVC 2022 (x64): Release + Debug binaries (.zip)
  • Windows Clang (x64): Release + Debug binaries (.zip)

Features:

  • βœ… Semantic versioning - Supports v0.0.1, v1.2.3 format tags
  • βœ… Dual build types - Both optimized Release and Debug binaries
  • βœ… Complete packaging - Binaries, headers, static libraries, documentation
  • βœ… Platform-specific archives - .tar.gz for Linux, .zip for Windows
  • βœ… Binary validation - Tests run before packaging to ensure functionality
  • βœ… Professional release notes - Auto-generated changelog with asset descriptions
  • βœ… Manual trigger support - Can create releases via workflow dispatch

Release Assets Structure:

utf_strings-v{version}-{Platform}/
β”œβ”€β”€ VERSION.txt                    # Release metadata
β”œβ”€β”€ utf_strings-tests-release      # Optimized test executable
β”œβ”€β”€ utf_strings-tests-debug        # Debug test executable
β”œβ”€β”€ utf_strings-bench-release      # Optimized benchmark executable  
β”œβ”€β”€ utf_strings-bench-debug        # Debug benchmark executable
β”œβ”€β”€ include/utf/                   # Complete header files
β”‚   β”œβ”€β”€ utf_codepoints.hpp
β”‚   └── version.hpp
β”œβ”€β”€ *.a/*.lib                      # Static libraries
β”œβ”€β”€ LICENSE                        # License file
└── README.md                      # Documentation

Usage Examples:

# Automatic trigger via tag
git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0

# Manual trigger via GitHub CLI
gh workflow run create-release.yml -f version=0.1.0 -f create_tag=true

# Manual trigger via GitHub UI
# Actions tab β†’ Create Release β†’ Run workflow β†’ Enter version

πŸ§ͺ extended-fuzz.yml - Extended Fuzz Testing

Triggers: Daily Schedule (2 AM UTC), Manual Dispatch Purpose: Long-running fuzz testing for thorough security validation

Jobs:

  • Extended Fuzz Testing: 1+ hour fuzzing sessions for all UTF encodings

Features:

  • βœ… Configurable duration (default 1 hour, manual override)
  • βœ… Comprehensive coverage (UTF-8, UTF-16 BE/LE, UTF-32 BE/LE)
  • βœ… Corpus management with persistent test cases
  • βœ… Automatic issue creation on crash detection
  • βœ… Detailed reporting with statistics and artifacts

πŸš€ release-validation.yml - Release Validation

Triggers: Release Published, Manual Dispatch Purpose: Comprehensive validation of release builds

Jobs:

  • Cross-Platform Release Builds: Linux (GCC/Clang) + Windows (MSVC/Clang-CL)
  • Security Validation: Enhanced security analysis for releases
  • Release Summary: Automated release documentation

Features:

  • βœ… Multi-platform validation with artifact generation
  • βœ… Binary security analysis with hardening verification
  • βœ… Performance validation with benchmark execution
  • βœ… Automated release notes with validation status
  • βœ… Release artifact packaging for distribution

Configuration Files

πŸ”§ codeql-config.yml - CodeQL Configuration

Purpose: Custom CodeQL analysis configuration

Features:

  • Security-focused query suites
  • Path filtering for relevant source code
  • C++-specific build configuration
  • Additional security query packs

Workflow Matrix Coverage

Platform Compiler Debug Release Tests Benchmarks Fuzz Sanitizers SAST Security CodeQL Pages Deploy Create Release
Linux x64 GCC 13 βœ… βœ… βœ… βœ… ❌ βœ… βœ… βœ… βœ… βœ…
Linux x64 Clang 18 βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ… βœ…
Windows x64 MSVC 2022 & Clang βœ… βœ… βœ… βœ… ⚠️* βœ…** βœ… βœ… βœ… βœ…

*Windows fuzz testing uses harnesses (no libFuzzer)
**Windows sanitizers: AddressSanitizer only
***SAST Security includes: Trivy, Checkov, Gitleaks, Cppcheck, Semgrep

Security Analysis Features

Comprehensive SAST Scanning

  • Trivy: Vulnerability scanning for containers, OS packages, and misconfigurations
  • Checkov: Infrastructure as Code security analysis (GitHub Actions, Docker, YAML/JSON)
  • Gitleaks: Secret detection across full git history
  • Cppcheck: C/C++ static analysis with configurable severity levels
  • Semgrep: Security pattern matching and vulnerability detection
  • CodeQL: Advanced semantic analysis with security queries
  • clang-tidy: Security-focused checks (security-, cert-, bugprone-*)

Dynamic Analysis

  • AddressSanitizer: Memory error detection (Linux GCC/Clang, Windows MSVC/Clang-CL)
  • ThreadSanitizer: Data race detection (Linux GCC/Clang)
  • UndefinedBehaviorSanitizer: Undefined behavior detection (Linux GCC/Clang)
  • LeakSanitizer: Memory leak detection (Linux GCC/Clang)
  • Valgrind: Memory analysis for releases (Linux)

Fuzz Testing

  • libFuzzer: Comprehensive fuzzing with sanitizers (Linux Clang)
  • Extended sessions: Daily 1+ hour fuzzing runs
  • Multi-encoding coverage: UTF-8, UTF-16 BE/LE, UTF-32 BE/LE
  • Corpus management: Persistent test case storage

Binary Security Analysis

  • Stack protection: Compiler-generated stack canaries
  • FORTIFY_SOURCE: Buffer overflow protection
  • PIE/ASLR: Address space layout randomization
  • NX bit: Non-executable stack protection

Performance Monitoring

Benchmark Tracking

  • Google Benchmark: Performance measurement framework
  • Baseline tracking: Automated performance regression detection
  • Alert system: 150% threshold for performance degradation
  • Cross-platform comparison: Performance across different compilers

Optimization Validation

  • Release builds: Aggressive optimization verification (-O3, /O2)
  • LTO verification: Link-time optimization effectiveness
  • Native CPU optimization: Platform-specific instruction usage

Artifact Management

Build Artifacts

  • Binaries: Tests and benchmark executables
  • Libraries: Static and shared libraries (.a, .so, .lib, .dll)
  • Headers: Complete include directory structure
  • Test results: XML format for reporting integration

Security Artifacts

  • SARIF files: Security analysis results
  • Crash dumps: Fuzz testing failures
  • Analysis reports: clang-tidy, cppcheck, valgrind outputs
  • Binary analysis: Security feature verification

Performance Artifacts

  • Benchmark results: JSON format with timing data
  • Performance baselines: Historical performance tracking
  • Regression reports: Performance change analysis

Integration Points

External Services

  • GitHub Security: CodeQL SARIF upload, security advisories
  • GitHub Releases: Automated validation and documentation
  • Artifact storage: GitHub Actions artifact system
  • Issue tracking: Automated issue creation on failures

Notification System

  • PR comments: Test results and performance impact
  • Release updates: Automated release notes with validation status
  • Alert system: Performance regression and security issue alerts
  • Email notifications: Critical failure notifications

Usage Examples

Running Workflows

# Create a new release (recommended approach)
git tag -a v0.1.0 -m "Release v0.1.0 - New features and improvements"
git push origin v0.1.0

# Create release manually via GitHub CLI
gh workflow run create-release.yml -f version=0.1.0 -f create_tag=true

# Trigger extended fuzz testing manually (2 hours)
gh workflow run extended-fuzz.yml -f duration=7200

# Validate a specific release
gh workflow run release-validation.yml -f release_tag=v1.0.0

# Check workflow status
gh run list --workflow=ci.yml

# Monitor release creation
gh run list --workflow=create-release.yml

Local Testing

# Reproduce CI builds locally
./bootstrap_cmake.sh --compiler gcc --config Release
./bootstrap_cmake.sh --compiler clang --config Debug --enable-fuzz

# Run security analysis locally
cmake --build --preset conan-release --target format-check
clang-tidy src/*.cpp include/*.hpp -- -std=c++23

This comprehensive CI/CD system ensures the UTF Strings library maintains high quality, security, and performance standards across all supported platforms! πŸš€

About

Vibe coding some utf-8 code in cpp

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages