Overview
Csound uses GitHub Actions for continuous integration and deployment. The CI/CD pipeline automatically builds, tests, and packages Csound for multiple platforms on every push and pull request.Workflows
The CI/CD system consists of multiple workflow files in.github/workflows/:
csound_builds.yml
Main build and test workflow for all platforms. Triggers:- Push to
masterordevelopbranches - Pull requests to
developbranch
- Linux builds (apt-get, vcpkg)
- macOS builds (Homebrew, installer, vcpkg)
- Windows builds (MSVC 64/32-bit, MinGW)
- iOS builds (native, cross-compilation)
- Android builds
- WebAssembly builds
- ARM bare-metal builds
csound_wasm.yml
WebAssembly-specific workflow using Nix. Triggers:- Pull requests to any branch
- Push to
developbranch
- Compile WebAssembly binaries
- Browser bundle build and test
- ESLint checks
- Browser unit tests
csound_build_images.yml
Builds Docker images for cross-compilation toolchains.Platform builds
Linux builds
Ubuntu with apt-get
Builds using system-installed dependencies:Ubuntu with vcpkg
Builds using vcpkg for dependency management:macOS builds
Homebrew build
Development build using Homebrew dependencies:Installer build
Production build with all dependencies included:Windows builds
MSVC 64-bit
MSVC 32-bit
Similar to 64-bit but with-A Win32 flag:
MinGW cross-compilation
Builds Windows binaries on Linux using MinGW:iOS builds
Native iOS build
Builds on macOS using Xcode:iOS cross-compilation
Cross-compiles iOS binaries on Linux using Docker:Android builds
NDK build (macOS)
vcpkg cross-compilation
Builds for multiple Android architectures:WebAssembly builds
Emscripten build
Nix-based WebAssembly
Alternative WebAssembly build using Nix:ARM bare-metal build
Builds for embedded ARM Cortex-M7:Testing in CI
Unit tests
Run on Linux, macOS, and Windows:Integration tests
Run CSD tests on all platforms:WebAssembly browser tests
Artifact generation
Upload artifacts
CI builds create artifacts for distribution:Artifact types
- Windows:
.exeinstallers,.dllbinaries - macOS:
.pkginstaller with universal binary - iOS: XCFramework zip
- Android: AAR packages
- ARM: Bare-metal libraries and examples
- WebAssembly: JavaScript bundles
Release process
Version management
Publish release
Publishes artifacts when a PR has therelease label:
Caching
vcpkg caching
vcpkg binary cache is stored in GitHub Actions cache:Emscripten caching
Nix caching
Concurrency control
Prevents multiple builds from the same ref:Docker images
Cross-compilation toolchain images:csound-android- Android NDK and toolchaincsound-ioscross- iOS cross-compilation toolscsound-osxcross- macOS cross-compilation tools
csound_build_images.yml and hosted on GitHub Container Registry.
Workflow optimization
Parallel jobs
Jobs run in parallel where possible:Conditional execution
Some jobs only run ondevelop:
Job dependencies
Some jobs depend on others:Debugging CI failures
View logs
Check the Actions tab on GitHub for detailed logs.Run locally
Useact to run GitHub Actions locally:
Enable debug logging
Add--verbose or -v flags to commands in the workflow.
SSH into runner
Useaction-tmate for interactive debugging (not enabled by default).
Best practices
Fast feedback
- Run quick tests first (Linux builds)
- Run expensive tests in parallel (installers)
- Cache dependencies aggressively
Reliability
- Pin action versions:
uses: actions/checkout@v5 - Use matrix builds for multiple configurations
- Set appropriate timeouts
Security
- Use secrets for tokens:
${{ secrets.GITHUB_TOKEN }} - Minimize permissions
- Validate inputs
Maintainability
- Keep workflows DRY (Don’t Repeat Yourself)
- Use reusable workflows and composite actions
- Document complex logic