# bitbucket-pipelines.yml # Lyrebird — Linux CI # # Builds and tests the Linux-supported surface of Lyrebird on the official # swift.org Ubuntu image, so a change that breaks the cross-platform port # (e.g. a new generator importing Accelerate/Darwin directly, C `stderr` usage # that trips Swift 6 concurrency on Linux, or a broken `#else`/`#elseif # os(Linux)` UI body) fails CI instead of shipping silently. # # One job, because `swift test` on a Linux host builds the WHOLE package graph — # and that graph now includes the cross-platform `LyrebirdUI` module, its GTK4 # backend (via the SwiftOpenUI fork), and the `LyrebirdUILinuxDemo` executable. # So the test job already compiles the Linux UI; it just needs the GTK dev # headers present. That makes the UI a first-class part of this job (its # regression lock — a macOS build can't see the Linux bodies, they're `#if`-d # out on Apple), and avoids a second parallel runner, which on BitBucket would # cost extra build minutes to recompile the same graph. # # The macOS/iOS build is unaffected: the Apple-only test targets (LyrebirdTests, # LyrebirdBenchmark — see Package.swift) are omitted on a Linux host; LyrebirdUI # itself is cross-platform (SwiftUI on Apple, SwiftOpenUI/GTK4 on Linux). # # Runners: BitBucket's Linux runners are x86_64, so this is a native amd64 # build — a second architecture beyond the Apple arm64 dev machines, which is # extra coverage, not a limitation. image: swift:6.3.3 definitions: caches: # Persist the SwiftPM build tree between runs to avoid recompiling the # whole graph every time. Keyed on the image's Swift version. swiftpm-build: .build steps: - step: &linux-build-test name: Linux build + test (GTK4, Swift 6.3.3) # The graph is large (core + SwiftOpenUI + the GTK4 backend + the demo); # give the compiler 8 GB — a 4 GB box OOM-cancels the link. size: 2x caches: - swiftpm-build script: - swift --version # Dev packages the Linux graph compiles against: # libgtk-4-dev — the SwiftOpenUI `CGTK` system library (pkgConfig # "gtk4"); without it `swift test` fails building # the UI graph with "gtk/gtk.h file not found". # libgtksourceview-5-dev — the SwiftOpenUI `CGtkSource` system library # (pkgConfig "gtksourceview-5") behind the CodeEditor # view (the live-compile scratch editor). # libfontconfig-dev — BackendGTK4 links fontconfig for its bundled-font # registration; gtk4's pkg-config --libs doesn't name it. # libasound2-dev — the core `CALSA` system-library target (the Linux # ALSA live-audio backend). See the LYREBIRD_DISABLE_ALSA # escape hatch in Package.swift for boxes with no audio. # pkg-config — resolves the above for SwiftPM. - apt-get update && apt-get install -y --no-install-recommends libgtk-4-dev libgtksourceview-5-dev libfontconfig-dev libasound2-dev pkg-config # Core build gate — the three portable shipping targets, checked # explicitly so a core-only regression fails fast with a clear target. - swift build --target LyrebirdSynth --target LyrebirdGraphDSL --target LyrebirdCLI # UI build gate — compiles the full LyrebirdUI + BackendGTK4 chain and # links the demo executable (compile-only; CI has no display, so no # `swift run`). The SwiftOpenUI fork is fetched from its pinned revision # (Package.swift), exactly as a developer's Linux build does. This is the # Linux-UI regression lock. - swift build --product LyrebirdUILinuxDemo # Run the Linux-runnable test targets (LyrebirdDSPTests, # LyrebirdGraphDSLTests, LyrebirdCLITests, LyrebirdPortableTests). # `swift test` builds and runs every target the Linux manifest exposes # (the Apple-only test targets are omitted on a Linux host — see # Package.swift). LyrebirdPortableTests carries the golden-value DSP # checks: this run is the only place the portable FFT/biquad/vector # fallbacks are verified to produce correct audio, since the parity # suite they replace compares against real vDSP and is Apple-only. - swift test # The documented escape hatch for a Linux box with no ALSA # development package. Exercised here because it is a manifest-level # branch: nothing else in this job compiles the package *without* # `CALSA`, so a regression there would only surface on a user's # machine. `swift test`, not just `swift build` — the ALSA driver's # own tests are `#if canImport(CALSA)`-guarded, and a guard that does # not match the driver's condition breaks compilation of the test # target alone, which a build-only check cannot see. - LYREBIRD_DISABLE_ALSA=1 swift test --scratch-path .build-noalsa pipelines: # Every branch push (covers the feature branch and main). default: - step: *linux-build-test # Pull requests targeting main. pull-requests: '**': - step: *linux-build-test