Files
Reaktor/.github/workflows/macos.yml
T
Roman ChojnackiandClaude Opus 5.5 f01e11d17e Build: link-time optimization on with Apple Clang; drop the LTO comparison
Apple Clang rendered bench 5-8% faster with it, with no new warnings, so
REAKTOR_LTO now defaults to ON there as with MSVC. The macOS release builds
its static libreaktor with it off, as the Windows release does, since its
objects link only with the same compiler. GCC (69 new warnings in
dependencies) and Clang on Linux (no gain, +8.6% size) stay off.

The decision made, tools/ci/lto-check.sh and its dispatch-only jobs go;
PERFORMANCE.md keeps the 2026-11-10 numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:09:20 +01:00

285 lines
11 KiB
YAML

name: macOS
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
workflow_call:
inputs:
version:
type: string
default: ''
permissions:
contents: read
concurrency:
group: macos-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
macos:
name: macos ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- { arch: arm64, runner: macos-15 }
- { arch: x86_64, runner: macos-15-intel }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
persist-credentials: false
- name: Install packages
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install ninja ccache
# ccache only: the build folder is rebuilt, so a stale cache cannot hide a broken one.
- name: Restore the compiler cache
id: ccache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-macos-${{ matrix.arch }}-${{ github.run_id }}
restore-keys: ccache-macos-${{ matrix.arch }}-
- name: Build
id: build
run: |
uname -a
sw_vers
cc --version
cmake --version
export CCACHE_DIR=$PWD/.ccache CCACHE_BASEDIR=$PWD CCACHE_MAXSIZE=500M
ccache -z
./build.sh -- -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON </dev/null
ccache -s
file build/showcase
- name: Save the compiler cache
if: ${{ always() && steps.build.outcome == 'success' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ${{ steps.ccache.outputs.cache-primary-key }}
- name: Console tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
fail=0
for t in $(cat tools/ci/tests.txt); do
echo "== $t"
if ./build/$t </dev/null; then :; else echo "$t: exit status $?"; fail=1; fi
done
exit "$fail"
- name: Shots and dumps
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: sh tools/ci/shots.sh build cocoa
- name: One copy at a time
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: sh tools/ci/instance.sh build
- name: Scripted UI test
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: sh tools/ci/uitest.sh build
- name: Package
id: package
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
version='${{ inputs.version || 'dev' }}'
name="reaktor-${version}-macos-${{ matrix.arch }}"
sh tools/package.sh build "dist/$name"
for p in showcase notepad simple bench; do
codesign --force --sign - "dist/$name/$p"
done
codesign --force --deep --sign - "dist/$name/reaktor.app"
echo "name=$name" >>"$GITHUB_OUTPUT"
- name: Check and zip the package
id: check
if: ${{ !cancelled() && steps.package.outcome == 'success' }}
run: |
dir="dist/${{ steps.package.outputs.name }}"
mkdir -p check
for from in "built build/showcase" "packed $dir/showcase" \
"bundled $dir/reaktor.app/Contents/MacOS/reaktor"; do
set -- $from
"$2" --tab 8 --theme light --video dummy \
--shot "check/$1.bmp" --a11y-dump "check/$1.txt" </dev/null
done
for e in bmp txt; do
cmp "check/built.$e" "check/packed.$e"
cmp "check/built.$e" "check/bundled.$e"
done
ditto -c -k --keepParent "$dir" "$dir.zip"
- name: Upload the package
if: ${{ !cancelled() && steps.check.outcome == 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: package-macos-${{ matrix.arch }}
path: dist/reaktor-*.zip
if-no-files-found: error
retention-days: 14
- name: Check and zip libreaktor
id: libcheck
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
version='${{ inputs.version || 'dev' }}'
name="libreaktor-${version}-macos-${{ matrix.arch }}"
cmake -S . -B build-lib -G Ninja -DCMAKE_BUILD_TYPE=Release -DREAKTOR_LTO=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON </dev/null
cmake --build build-lib --target libreaktor </dev/null
cmake --install build-lib --prefix "dist/$name" --component libreaktor </dev/null
cmake -S examples/consumer -B build-consumer -G Ninja -DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_PREFIX_PATH=$PWD/dist/$name" </dev/null
cmake --build build-consumer </dev/null
mkdir -p check
for from in "lib-built build/simple" "lib-linked build-consumer/simple"; do
set -- $from
"$2" --theme light --video dummy \
--shot "check/$1.bmp" --a11y-dump "check/$1.txt" </dev/null
done
for e in bmp txt; do
cmp "check/lib-built.$e" "check/lib-linked.$e"
done
ditto -c -k --keepParent "dist/$name" "dist/$name.zip"
- name: Shared libreaktor
id: shared
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
export CCACHE_DIR=$PWD/.ccache CCACHE_BASEDIR=$PWD CCACHE_MAXSIZE=500M
version='${{ inputs.version || 'dev' }}'
name="libreaktor-shared-${version}-macos-${{ matrix.arch }}"
cmake -S . -B build-shared -G Ninja -DCMAKE_BUILD_TYPE=Release -DREAKTOR_SHARED=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON </dev/null
cmake --build build-shared </dev/null
sh tools/ci/check-libreaktor.sh build-shared "$name" </dev/null
tar -C dist -xzf "dist/$name.tar.gz"
rm "dist/$name.tar.gz"
ditto -c -k --keepParent "dist/$name" "dist/$name.zip"
rm -rf "dist/$name"
- name: Upload the shared libreaktor
if: ${{ !cancelled() && steps.shared.outcome == 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: package-libreaktor-shared-macos-${{ matrix.arch }}
path: |
dist/libreaktor-shared-*.zip
if-no-files-found: error
retention-days: 14
- name: Check an app that embeds Reaktor
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
export CCACHE_DIR=$PWD/.ccache CCACHE_BASEDIR=$PWD CCACHE_MAXSIZE=500M
cmake -S examples/embedded -B build-embedded -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON </dev/null
cmake --build build-embedded --target simple </dev/null
mkdir -p check
for from in "tree build/simple" "embedded build-embedded/simple"; do
set -- $from
"$2" --theme light --video dummy \
--shot "check/$1.bmp" --a11y-dump "check/$1.txt" </dev/null
done
for e in bmp txt; do
cmp "check/tree.$e" "check/embedded.$e"
done
- name: Upload libreaktor
if: ${{ !cancelled() && steps.libcheck.outcome == 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: package-libreaktor-macos-${{ matrix.arch }}
path: |
dist/libreaktor-*.zip
!dist/libreaktor-shared-*.zip
if-no-files-found: error
retention-days: 14
- name: Upload the shots
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: macos-${{ matrix.arch }}
path: smoke/
if-no-files-found: warn
retention-days: 14
universal:
name: macos universal
needs: macos
if: ${{ !cancelled() }}
runs-on: macos-15
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
persist-credentials: false
- name: Install packages
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install ninja
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: package-libreaktor-shared-macos-arm64
path: dl/arm64
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: package-libreaktor-shared-macos-x86_64
path: dl/x86_64
- name: Join and check the universal libreaktor
run: |
v='${{ inputs.version || 'dev' }}'
for a in arm64 x86_64; do ditto -x -k "dl/$a/libreaktor-shared-$v-macos-$a.zip" "u/$a"; done
A="u/arm64/libreaktor-shared-$v-macos-arm64"
X="u/x86_64/libreaktor-shared-$v-macos-x86_64"
U="dist/libreaktor-shared-$v-macos-universal"
mkdir -p dist
ditto "$A" "$U"
(cd "$A" && find . -type f) | while read -r f; do
if file -b "$A/$f" | grep -q -E 'Mach-O|ar archive'; then
lipo -create "$A/$f" "$X/$f" -output "$U/$f"
else
cmp "$A/$f" "$X/$f"
fi
done
codesign --force --sign - "$U/Frameworks/Reaktor.framework"
lipo -info "$U/Frameworks/Reaktor.framework/Reaktor"
lipo "$U/Frameworks/Reaktor.framework/Reaktor" -verify_arch arm64 x86_64
lipo "$U/lib/libreaktor-modules.a" -verify_arch arm64 x86_64
cmake -S examples/consumer -B build-consumer -G Ninja -DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_PREFIX_PATH=$PWD/$U" -DCONSUMER_SHARED=ON \
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" </dev/null
cmake --build build-consumer </dev/null
lipo build-consumer/simple -verify_arch arm64 x86_64
mkdir -p check
build-consumer/simple --theme light --video dummy \
--shot check/universal.bmp --a11y-dump check/universal.txt </dev/null
ditto -c -k --keepParent "$U" "$U.zip"
- name: Upload the universal libreaktor
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: package-libreaktor-shared-macos-universal
path: dist/libreaktor-shared-*-macos-universal.zip
if-no-files-found: error
retention-days: 14