-
-
Notifications
You must be signed in to change notification settings - Fork 455
170 lines (147 loc) · 5.91 KB
/
build_osx.yml
File metadata and controls
170 lines (147 loc) · 5.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: macOS
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- "*"
jobs:
build-shared:
name: "Libs: ${{ matrix.libs }}, FS Lib: ${{ matrix.fslib }}, Arch: ${{ matrix.arch }}, Build OS: ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
libs: ['shared', 'static']
fslib: ['stl', 'boost']
arch: ['arm64', 'x86_64']
runs-on: ['macos-15', 'macos-15-intel']
exclude:
- arch: arm64
runs-on: macos-15-intel
- arch: x86_64
runs-on: macos-15
### BROKEN: Homebrew's Boost build for arm64 does not properly populate the include dir of the Boost CMake targets.
- arch: arm64
runs-on: macos-15
fslib: boost
steps:
- name: Install Packages
run: brew install sdl2 ninja googletest
- name: Install boost-filesystem-dev
if: "${{ contains(matrix.fslib, 'boost') }}"
run: |
brew install boost
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure Build
run: |
if [ "${{ matrix.libs }}" == "shared" ]; then
shared_libs=ON
else
shared_libs=OFF
fi
if [ "${{ matrix.fslib }}" == "boost" ]; then
use_boost=ON
else
use_boost=OFF
fi
cmake -G "Ninja Multi-Config" \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/cmake-build" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
-DCMAKE_VERBOSE_MAKEFILE=YES \
-DBUILD_SHARED_LIBS="${shared_libs}" \
-DENABLE_BOOST_FILESYSTEM="${use_boost}" \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" \
-DENABLE_CXX_INTERFACE=YES \
-DBUILD_TESTING=YES
- name: Build Debug
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --parallel
- name: Run Unit Tests
run: ctest --test-dir "${{ github.workspace }}/cmake-build" --verbose --build-config "Debug"
- name: Build Release
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --parallel
- name: Install
run: |
cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --target install
cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
- name: Test C++ Interface
run: |
cmake -G "Ninja Multi-Config" \
-S "${{ github.workspace }}/tests/cxx-interface" \
-B "${{ github.workspace }}/cmake-build-cxx-api" \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/install"
cmake --build "${{ github.workspace }}/cmake-build-cxx-api" --config "Debug"
cmake --build "${{ github.workspace }}/cmake-build-cxx-api" --config "Release"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: projectm-osx-${{ matrix.libs }}-${{ matrix.fslib }}-${{ matrix.arch }}-${{ matrix.runs-on }}
path: install/*
build-framework:
name: "Framework: ${{ matrix.cxx_interface && 'C + C++' || 'C only' }}, Arch: ${{ matrix.arch }}, Build OS: ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
arch: ['arm64', 'x86_64']
cxx_interface: [true, false]
runs-on: ['macos-15', 'macos-15-intel']
exclude:
- arch: arm64
runs-on: macos-15-intel
- arch: x86_64
runs-on: macos-15
steps:
- name: Install Packages
run: brew install ninja
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure Framework Build
run: |
if [ "${{ matrix.cxx_interface }}" == "true" ]; then
cxx_iface=ON
else
cxx_iface=OFF
fi
cmake -G "Ninja Multi-Config" \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/cmake-build" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
-DCMAKE_VERBOSE_MAKEFILE=YES \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_MACOS_FRAMEWORK=ON \
-DENABLE_CXX_INTERFACE="${cxx_iface}" \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
- name: Build Release
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --parallel
- name: Validate Frameworks
run: |
STRICT=1 bash "${{ github.workspace }}/scripts/test-macos-framework.sh" \
"${{ github.workspace }}/cmake-build"
- name: Install
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
- name: Verify Installed Frameworks
run: |
echo "--- Checking installed framework structure ---"
ls -la "${{ github.workspace }}/install/lib/"
# Verify frameworks were installed (not bare dylibs)
test -d "${{ github.workspace }}/install/lib/projectM-4.framework" \
|| { echo "FAIL: projectM-4.framework not installed"; exit 1; }
test -d "${{ github.workspace }}/install/lib/projectM-4-playlist.framework" \
|| { echo "FAIL: projectM-4-playlist.framework not installed"; exit 1; }
# Run the same validation on installed frameworks
STRICT=1 bash "${{ github.workspace }}/scripts/test-macos-framework.sh" \
"${{ github.workspace }}/install"
- name: Upload Framework Artifact
uses: actions/upload-artifact@v4
with:
name: projectm-osx-framework-${{ matrix.cxx_interface && 'cxx' || 'c-only' }}-${{ matrix.arch }}-${{ matrix.runs-on }}
path: install/*