Skip to content

🚀 CI/CD Quick Start

Set up continuous integration for AudioLab in 5 steps


Prerequisites

  • ✅ GitHub repository for AudioLab
  • ✅ Admin access to repository settings
  • ✅ Basic understanding of Git workflows

Step 1: Copy Workflow Files (2 minutes)

AudioLab provides production-ready GitHub Actions workflows.

# Copy workflows to your repository
cp -r ".github/workflows" "your-repo/.github/"

# Commit
git add .github/workflows
git commit -m "Add AudioLab CI/CD workflows"
git push

Option B: Use Templates

# Create workflows directory
mkdir -p .github/workflows

# Copy from templates
cp "2 - FOUNDATION/03_INFRA/03_06_ci_cd_automation/03_06_00_github_actions/ci.yml" \
   ".github/workflows/ci.yml"

cp "2 - FOUNDATION/03_INFRA/03_06_ci_cd_automation/03_06_00_github_actions/release.yml" \
   ".github/workflows/release.yml"

Expected result: .github/workflows/ directory with CI configuration


Step 2: Configure Repository Secrets (3 minutes)

Some workflows require secrets for authentication.

Required Secrets (Optional)

Secret Used For How to Get
CODECOV_TOKEN Code coverage reports codecov.io
RELEASE_TOKEN Publishing releases GitHub Settings → Developer → PAT

Setting Secrets

  1. Go to your GitHub repository
  2. Click SettingsSecrets and variablesActions
  3. Click New repository secret
  4. Add each secret

Skip if not using: Workflows will run without these, but some features disabled.


Step 3: Push and Trigger First CI Run (1 minute)

# Make a small change (e.g., edit README)
echo "# Testing CI" >> README.md

# Commit and push to trigger CI
git add README.md
git commit -m "Test CI pipeline"
git push origin main

Expected result: GitHub Actions starts building your code.


Step 4: Monitor CI Run (2-15 minutes)

  1. Go to your GitHub repository
  2. Click Actions tab
  3. Click on the running workflow ("AudioLab CI")
  4. Watch the build progress

What's happening:

┌──────────────────────────────────────┐
│  1. Checkout code                     │  30s
├──────────────────────────────────────┤
│  2. Setup build tools (CMake, vcpkg) │  2 min
├──────────────────────────────────────┤
│  3. Install dependencies (cached)     │  1 min
├──────────────────────────────────────┤
│  4. Configure with CMake              │  1 min
├──────────────────────────────────────┤
│  5. Build (Debug + Release)           │  5-8 min
├──────────────────────────────────────┤
│  6. Run tests                         │  1-2 min
├──────────────────────────────────────┤
│  7. Upload artifacts                  │  30s
└──────────────────────────────────────┘

Total: ~12-15 minutes (first run)
       ~8-10 minutes (cached)


Step 5: Fix Any Issues (Variable)

Success - All checks passed

You'll see green checkmarks ✅. You're done!

Failure - Some checks failed

Click on the failed job to see the error:

Common issues:

  1. "CMakeLists.txt not found"
  2. Fix: Ensure CMakeLists.txt is in repository root
  3. Push the fix

  4. "vcpkg package not found"

  5. Fix: Add missing package to vcpkg.json
  6. Example:

    {
      "dependencies": [
        "catch2",
        "fftw3",
        "eigen3"
      ]
    }
    

  7. "Tests failed"

  8. Fix: Tests must pass locally first
  9. Run: ctest --output-on-failure
  10. Fix failing tests, then push

  11. "Formatting check failed"

  12. Fix: Run clang-format
  13. clang-format -i **/*.cpp **/*.hpp
  14. Commit and push

For detailed troubleshooting, see TROUBLESHOOTING.md


Next Steps

Enable Branch Protection

Require CI to pass before merging:

  1. Go to SettingsBranches
  2. Click Add rule for main
  3. Enable:
  4. ☑ Require status checks to pass
  5. ☑ Require branches to be up to date
  6. Select: build-and-test
  7. Save

Add Status Badge

Show CI status in your README:

![CI Status](https://github.com/your-user/your-repo/workflows/AudioLab%20CI/badge.svg)

Customize Workflows

See CI_CHEAT_SHEET.md for common customizations.


Available Workflows

AudioLab provides 11 production workflows:

Workflow File Trigger Purpose
Main CI ci.yml Push/PR to main Full build & test
Test Suite test-suite.yml Push Comprehensive testing
Benchmarks benchmark.yml Manual Performance testing
Code Quality code-quality.yml PR Linting, formatting
Security security-scan.yml Daily Dependency scanning
Release release.yml Tag push Build & publish release

Most important: ci.yml - runs on every commit.


Understanding Build Matrix

The CI runs 6 parallel jobs:

Windows × Debug    → MSVC 2022, x64, VST3/AAX
Windows × Release  → Optimized build

macOS × Debug      → Clang 15, Universal Binary, VST3/AU
macOS × Release    → Optimized build

Linux × Debug      → GCC 12, x64, VST3/LV2
Linux × Release    → Optimized build

Total CI time: ~12-15 minutes (all jobs run in parallel)


Caching

AudioLab CI uses smart caching to speed up builds:

  • vcpkg dependencies: Cached per OS (rarely changes)
  • CMake build artifacts: Cached per configuration
  • ccache (Linux/macOS): Incremental compilation

Result: Second run ~40% faster (15 min → 8-10 min)


Monitoring Costs

GitHub Actions is free for public repos.

For private repos: - Free tier: 2,000 minutes/month - AudioLab usage: ~15 min/run × 3 platforms = 45 min/commit - Budget: ~44 commits/month on free tier

Optimization: Use paths-ignore to skip CI for docs-only changes.


Local CI Testing

Test before pushing to save CI minutes:

# Run local "CI" checks
./scripts/local-ci-check.sh

# Or manually:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure

Resources


Quick Copy-Paste Setup

# 1. Copy workflows
cp -r .github/workflows ~/my-audiolab-project/.github/

# 2. Commit
cd ~/my-audiolab-project
git add .github/workflows
git commit -m "Add CI/CD workflows"

# 3. Push and trigger
git push origin main

# 4. Watch at:
# https://github.com/your-user/your-repo/actions

Your CI/CD is now running! 🎉

Every commit will automatically: - ✅ Build on Windows, macOS, Linux - ✅ Run all tests - ✅ Check code quality - ✅ Generate artifacts

No manual work required!