Skip to content

๐Ÿš€ AudioLab CI/CD Workflows

Overview

Complete automated build, test, security, and release pipeline for AudioLab. All workflows are optimized for performance with intelligent caching and parallel execution.

๐Ÿ“‹ Workflow Catalog

1. CI - Complete Build & Test (ci-improved.yml) โญ PRIMARY

Triggers: Push to main/develop, Pull Requests to main, Manual

Multi-Platform Build Matrix: - โœ… Windows MSVC 2022 - โœ… Ubuntu GCC 11 - โœ… Ubuntu Clang 14 - โœ… macOS Apple Clang

What it does: - Format check (fail-fast) - Build all CORE modules - Run complete test suite - Upload build artifacts - Generate test reports

Duration: ~15-20 min (with cache)


2. Code Quality (code-quality.yml) ๐Ÿ”

Triggers: Push, PR, Manual

Quality Checks: - โœ… clang-format compliance - โœ… clang-tidy static analysis - โœ… cppcheck additional checks - โœ… Complexity analysis (CCN <15)

Quality Gates: - Code must be formatted - No critical warnings - Complexity within limits


3. Test Suite (test-suite.yml) ๐Ÿงช

Triggers: Push, PR, Manual

Testing Matrix: - โœ… 3 platforms ร— 2 build types (Debug/Release) - โœ… Complete code coverage (lcov) - โœ… Codecov integration - โœ… 70% coverage threshold

Coverage Requirement: โ‰ฅ70% line coverage


4. Security Scan (security-scan.yml) ๐Ÿ”’

Triggers: Push, PR, Weekly (Mon 9AM UTC), Manual

Security Checks: - โœ… CodeQL SAST analysis - โœ… Dependency vulnerabilities - โœ… Secrets detection (TruffleHog) - โœ… License compliance

Schedule: Weekly automated scans


5. Performance Benchmarks (benchmark.yml) ๐Ÿ“Š

Triggers: Push, PR, Weekly (Sun 12AM UTC), Manual

Benchmarking: - โœ… Google Benchmark suite - โœ… PR vs main comparison - โœ… Regression detection - โœ… Performance reports


6. Release - Multi-Platform (release-improved.yml) ๐Ÿš€

Triggers: Git tags (v*.*.*), Manual

Release Artifacts: - โœ… Windows x64 (ZIP) - โœ… macOS Universal (tar.gz) - โœ… Linux x64 (tar.gz) - โœ… Auto-generated changelog - โœ… Draft release creation

Usage:

git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0


7. Manual Workflows (manual-dispatch.yml) ๐Ÿ› ๏ธ

Triggers: Manual only

Available Commands: - full-build - Complete build & test - quick-test - Tests only (no rebuild) - clean-rebuild - Clean rebuild - benchmark - Benchmarks only - security-scan - Security scan - format-fix - Auto-fix formatting


8. Cache Dependencies (cache-deps.yml) โšก

Triggers: Weekly (Sun 12AM UTC), Manual

Caching: - โœ… vcpkg packages - โœ… Build dependencies - โœ… ~10min time savings


๐ŸŽฏ Status Badges

Add to your README.md:

![CI](https://github.com/yourusername/audio-lab/actions/workflows/ci-improved.yml/badge.svg)
![Quality](https://github.com/yourusername/audio-lab/actions/workflows/code-quality.yml/badge.svg)
![Tests](https://github.com/yourusername/audio-lab/actions/workflows/test-suite.yml/badge.svg)
![Security](https://github.com/yourusername/audio-lab/actions/workflows/security-scan.yml/badge.svg)
[![codecov](https://codecov.io/gh/yourusername/audio-lab/branch/main/graph/badge.svg)](https://codecov.io/gh/yourusername/audio-lab)

๐Ÿ”ง Configuration

Dependabot (dependabot.yml)

  • GitHub Actions: Weekly (Mon)
  • Python deps: Weekly (Tue)
  • Docker images: Weekly (Wed)

Code Owners (CODEOWNERS)

  • Auto-assign reviewers by file path
  • Core team for CORE modules
  • Security team for security files

Local Testing

Simulate CI Locally

Before pushing, test your changes locally:

1. Format Check

# Windows
cd "2 - FOUNDATION"
.\03_INFRA\03_10_quality_standards\scripts\format_all.ps1 -Check
# Linux
cd "2 - FOUNDATION"
pwsh 03_INFRA/03_10_quality_standards/scripts/format_all.ps1 -Check

2. Build & Test

# Math Primitives
cd "2 - FOUNDATION/04_CORE/04_02_math_primitives"
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

# Core Interfaces
cd "2 - FOUNDATION/04_CORE/04_01_core_interfaces/04_factory_interfaces"
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

3. Static Analysis

cd "2 - FOUNDATION/04_CORE/04_02_math_primitives"
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
clang-tidy -p build **/*.cpp **/*.hpp

CI Configuration

Environment Variables

  • GITHUB_TOKEN - Automatically provided by GitHub Actions
  • CODECOV_TOKEN - (Optional) For Codecov.io integration

Caching Strategy

  • vcpkg packages: Cached by vcpkg.json hash
  • Build artifacts: Not cached (rebuilt each time)
  • Test results: Uploaded as artifacts for 30 days

Supported Platforms

Platform OS Compiler Architecture
Windows windows-latest MSVC 2022 x64
Linux ubuntu-latest GCC 11/Clang 14 x64

Debugging CI Failures

View Logs

  1. Go to the Actions tab in GitHub
  2. Click on the failed workflow run
  3. Select the failed job
  4. Expand the failed step to view logs

Download Test Artifacts

Failed test results are uploaded as artifacts: 1. Go to the workflow run 2. Scroll to Artifacts section 3. Download test-results-windows or test-results-linux

Common Issues

Format Check Fails

Problem: Code style doesn't match clang-format rules

Solution:

# Auto-format code
cd "2 - FOUNDATION"
.\03_INFRA\03_10_quality_standards\scripts\format_all.ps1

Build Fails (Windows)

Problem: MSVC compiler errors

Solution: - Check that all headers are included - Verify Windows-specific code paths - Review compiler output in Actions logs

Tests Fail

Problem: Unit tests failing in CI but passing locally

Solution: - Check for platform-specific issues - Verify test data paths are relative - Review uploaded test artifacts

Cache Miss

Problem: vcpkg cache not being used

Solution: - Manually trigger cache-deps.yml workflow - Verify vcpkg.json hasn't changed - Check cache key in workflow logs

Workflow Maintenance

Updating Dependencies

When adding new vcpkg dependencies: 1. Update vcpkg.json 2. Manually trigger "Cache Dependencies" workflow 3. Wait for cache to update before next CI run

Modifying Workflows

To update workflows: 1. Edit .github/workflows/*.yml 2. Test locally using act (optional) 3. Push to a feature branch 4. Create PR to review changes

Performance Optimization

Current CI times (approximate): - Format check: ~2 minutes - Windows build: ~10 minutes (5 minutes with cache) - Linux build: ~8 minutes (3 minutes with cache) - Static analysis: ~5 minutes - Total: ~25 minutes (15 minutes with cache)

Security

Secrets Management

No secrets are required for basic CI/CD. Optional secrets: - CODECOV_TOKEN - For coverage upload - RELEASE_TOKEN - For automated releases (uses default GITHUB_TOKEN)

Permissions

Workflows use minimal permissions: - contents: read - Default for checkout - contents: write - Only for releases - No access to secrets or sensitive data

๐Ÿ“š Additional Resources


๐ŸŽฏ Quality Standards

All PRs must pass: - โœ… Format check (clang-format) - โœ… Build on all platforms - โœ… All tests pass - โœ… Coverage โ‰ฅ70% - โœ… No security issues - โœ… Complexity CCN <15


Maintained by: AudioLab DevOps Team Last Updated: 2025-10-08