Skip to content

Commit e570565

Browse files
committed
Add CI: GitHub Actions build for Ubuntu and macOS
The TE modules are JUCE INTERFACE libraries — header-only until a consumer pulls them in — so CI needs an actual link target to compile the .cpp files. Adds: - ci/compile_check.cpp: tiny console-app entry that constructs an Engine and exits, just to force every module .cpp to be compiled. - CMakeLists.txt: TE_BUILD_COMPILE_CHECK option (off by default) that pulls compile_check.cpp into a juce_add_console_app target and links the three TE modules. - .github/workflows/build.yml: matrix build on ubuntu-latest and macos-latest, Release config, runs on push to main/master/feat/**/ fix/**, on every PR, and on manual dispatch. Per-ref concurrency cancellation so superseded runs don't queue. Forks without CI silently miss compile breakage between MAGDA bumps — this catches it before merge instead of at the consumer's build.
1 parent e837e95 commit e570565

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- "feat/**"
9+
- "fix/**"
10+
pull_request:
11+
workflow_dispatch:
12+
13+
# Cancel in-progress runs when a new commit is pushed to the same ref.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
name: ${{ matrix.os }} / ${{ matrix.config }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ ubuntu-latest, macos-latest ]
26+
config: [ Release ]
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
34+
- name: Install Linux build dependencies
35+
if: runner.os == 'Linux'
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y --no-install-recommends \
39+
ninja-build \
40+
libasound2-dev libjack-jackd2-dev \
41+
libcurl4-openssl-dev libfreetype-dev libfontconfig1-dev \
42+
libx11-dev libxcomposite-dev libxcursor-dev libxext-dev \
43+
libxinerama-dev libxrandr-dev libxrender-dev \
44+
libgl1-mesa-dev
45+
46+
- name: Install macOS build dependencies
47+
if: runner.os == 'macOS'
48+
run: brew install ninja
49+
50+
- name: Configure
51+
run: >
52+
cmake -S . -B build
53+
-G Ninja
54+
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
55+
-DTE_BUILD_COMPILE_CHECK=ON
56+
57+
- name: Build
58+
run: cmake --build build --config ${{ matrix.config }} --parallel
59+
60+
- name: Upload build log on failure
61+
if: failure()
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: build-log-${{ matrix.os }}-${{ matrix.config }}
65+
path: |
66+
build/CMakeFiles/CMakeOutput.log
67+
build/CMakeFiles/CMakeError.log
68+
build/.ninja_log
69+
if-no-files-found: ignore

CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ cmake_minimum_required(VERSION 3.15)
33
# Add a build option for enabling examples (OFF by default for Magica minimal build)
44
option(TE_ADD_EXAMPLES "Add the example targets" OFF)
55

6+
# When ON, builds a tiny console app that links the TE modules so CI actually
7+
# compiles the .cpp files (the modules themselves are header-only INTERFACE
8+
# targets until a consumer pulls them in). See ci/compile_check.cpp and
9+
# .github/workflows/build.yml.
10+
option(TE_BUILD_COMPILE_CHECK "Build the CI compile-check target" OFF)
11+
612
# Read version from VERSION.md
713
file(READ VERSION.md CURRENT_VERSION)
814
string(STRIP ${CURRENT_VERSION} CURRENT_VERSION)
@@ -27,3 +33,26 @@ if (TE_ADD_EXAMPLES)
2733
enable_testing()
2834
add_subdirectory(examples)
2935
endif()
36+
37+
if (TE_BUILD_COMPILE_CHECK)
38+
juce_add_console_app(te_compile_check
39+
PRODUCT_NAME "te-compile-check")
40+
41+
target_sources(te_compile_check PRIVATE ci/compile_check.cpp)
42+
43+
target_compile_definitions(te_compile_check PRIVATE
44+
JUCE_USE_CURL=0
45+
JUCE_WEB_BROWSER=0
46+
JUCE_PLUGINHOST_VST3=0
47+
JUCE_PLUGINHOST_AU=0
48+
JUCE_PLUGINHOST_LADSPA=0)
49+
50+
target_link_libraries(te_compile_check PRIVATE
51+
tracktion::tracktion_engine
52+
tracktion::tracktion_core
53+
tracktion::tracktion_graph
54+
juce::juce_audio_utils
55+
juce::juce_recommended_config_flags
56+
juce::juce_recommended_lto_flags
57+
juce::juce_recommended_warning_flags)
58+
endif()

ci/compile_check.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Minimal compile-check consumer for the Tracktion Engine modules.
2+
// Linked into the te_compile_check console app target when TE_BUILD_COMPILE_CHECK
3+
// is ON (used by .github/workflows/build.yml). The point is to force every
4+
// .cpp in tracktion_core / tracktion_engine / tracktion_graph to actually
5+
// compile under CI — JUCE module libraries are header-only INTERFACE targets
6+
// until something downstream pulls them in.
7+
8+
#include <tracktion_engine/tracktion_engine.h>
9+
10+
int main()
11+
{
12+
// Construct an Engine just to make sure the module's static init paths
13+
// run cleanly. Anything more would be a runtime test, not a build smoke.
14+
tracktion::engine::Engine engine { "te-compile-check" };
15+
return 0;
16+
}

0 commit comments

Comments
 (0)