[ci] Add support for to_underlying #400
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake build | |
on: push | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Windows", | |
os: windows-latest, | |
path: "/c/ossia-sdk/llvm/bin", | |
common_flags: "-GNinja \ | |
-DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang.exe \ | |
-DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++.exe \ | |
-DCMAKE_EXE_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" \ | |
-DCMAKE_SHARED_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" \ | |
-DCMAKE_MODULE_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" ", | |
debug_flags: "-DCMAKE_BUILD_TYPE=Debug", | |
release_flags: "-DCMAKE_BUILD_TYPE=Release", | |
build_flags: "", | |
dependencies: "choco install -y ninja", | |
sdk: "/c/ossia-sdk", | |
} | |
- { | |
name: "Ubuntu (clang)", | |
os: ubuntu-22.04, | |
path: "/opt/ossia-sdk/llvm/bin", | |
common_flags: "-DCMAKE_C_COMPILER=/usr/bin/clang-15 \ | |
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 \ | |
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ | |
-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ | |
-DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld", | |
debug_flags: "-DCMAKE_BUILD_TYPE=Debug", | |
release_flags: "-DCMAKE_BUILD_TYPE=Release", | |
build_flags: "", | |
dependencies: "sudo apt update ; \ | |
sudo apt install lsb-release wget software-properties-common ; \ | |
curl -L https://apt.llvm.org/llvm.sh > llvm.sh ; \ | |
chmod +x ./llvm.sh ; \ | |
sudo ./llvm.sh ; \ | |
sudo apt update ; \ | |
sudo apt install ninja-build clang-15 lld-15 libc++-15-dev libc++1-15 libc++abi1-15 libc++abi-15-dev", | |
sdk: "/opt/ossia-sdk", | |
} | |
- { | |
name: "Ubuntu (GCC)", | |
os: ubuntu-22.04, | |
common_flags: "-DCMAKE_C_COMPILER=/usr/bin/gcc-12 \ | |
-DCMAKE_CXX_COMPILER=/usr/bin/g++-12", | |
debug_flags: "-DCMAKE_BUILD_TYPE=Debug", | |
release_flags: "-DCMAKE_BUILD_TYPE=Release", | |
build_flags: "", | |
dependencies: "sudo apt update ; \ | |
sudo apt install lsb-release wget software-properties-common ; \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test ; \ | |
sudo apt update ; \ | |
sudo apt install ninja-build gcc-12 g++-12", | |
sdk: "/opt/ossia-sdk", | |
} | |
- { | |
name: "macOS", | |
os: macos-latest, | |
common_flags: "", | |
debug_flags: "-DCMAKE_BUILD_TYPE=Debug", | |
release_flags: "-DCMAKE_BUILD_TYPE=Release", | |
build_flags: "", | |
sdk: "/opt/ossia-sdk-x86_64", | |
} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Checkout dependencies | |
uses: actions/checkout@v2 | |
with: | |
repository: ossia/score | |
submodules: "recursive" | |
path: score | |
- name: Install dependencies | |
shell: bash | |
run: | | |
${{ matrix.config.dependencies }} | |
- name: Download SDK | |
shell: bash | |
run: | | |
curl -L https://raw.githubusercontent.com/ossia/score/master/tools/fetch-sdk.sh > fetch-sdk.sh | |
chmod +x ./fetch-sdk.sh | |
./fetch-sdk.sh | |
- uses: maxim-lobanov/setup-xcode@v1 | |
if: matrix.config.name == 'macOS' | |
with: | |
xcode-version: latest-stable | |
- name: Build debug | |
shell: bash | |
run: | | |
mkdir build-debug | |
cd build-debug | |
if [[ "${{ matrix.config.path }}" != "" ]]; then | |
export PATH=${{ matrix.config.path }}:$PATH | |
fi | |
export SDK_3RDPARTY=$PWD/../score/3rdparty | |
export VERBOSE=1 | |
cmake .. \ | |
-DBOOST_ROOT=${{ matrix.config.sdk }}/boost \ | |
-Dpybind11_DIR=$SDK_3RDPARTY/libossia/3rdparty/pybind11 \ | |
-DAVND_MAXSDK_PATH=$SDK_3RDPARTY/libossia/3rdparty/max-sdk \ | |
-DVST3_SDK_ROOT=$SDK_3RDPARTY/vst3 \ | |
-DCMAKE_PREFIX_PATH="$SDK_3RDPARTY/libpd/pure-data/src" \ | |
${{ matrix.config.common_flags }} \ | |
${{ matrix.config.debug_flags }} | |
cmake --build . -- ${{ matrix.config.build_flags }} | |
- name: Test debug | |
shell: bash | |
run: | | |
cd build-debug | |
if [[ "${{ matrix.config.path }}" != "" ]]; then | |
export PATH=${{ matrix.config.path }}:$PATH | |
fi | |
cmake --build . --target test | |
- name: Build release | |
shell: bash | |
run: | | |
mkdir build-release | |
cd build-release | |
if [[ "${{ matrix.config.path }}" != "" ]]; then | |
export PATH=${{ matrix.config.path }}:$PATH | |
fi | |
export SDK_3RDPARTY=$PWD/../score/3rdparty | |
export VERBOSE=1 | |
cmake .. \ | |
-DBOOST_ROOT=${{ matrix.config.sdk }}/boost \ | |
-Dpybind11_DIR=$SDK_3RDPARTY/libossia/3rdparty/pybind11 \ | |
-DAVND_MAXSDK_PATH=$SDK_3RDPARTY/libossia/3rdparty/max-sdk \ | |
-DVST3_SDK_ROOT=$SDK_3RDPARTY/vst3 \ | |
-DCMAKE_PREFIX_PATH="$SDK_3RDPARTY/libpd/pure-data/src;$SDK_3RDPARTY/libossia/3rdparty/pybind11" \ | |
${{ matrix.config.common_flags }} \ | |
${{ matrix.config.release_flags }} | |
cmake --build . -- ${{ matrix.config.build_flags }} | |
- name: Test release | |
shell: bash | |
run: | | |
cd build-release | |
if [[ "${{ matrix.config.path }}" != "" ]]; then | |
export PATH=${{ matrix.config.path }}:$PATH | |
fi | |
cmake --build . --target test |