2020-01-04 13:11:09 +00:00
|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- {
|
|
|
|
name: "Visual Studio 64-bit",
|
|
|
|
os: windows-latest,
|
|
|
|
build_type: "Release",
|
|
|
|
extra_options: "-A x64"
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "Visual Studio 32-bit",
|
|
|
|
os: windows-latest,
|
|
|
|
build_type: "Release",
|
|
|
|
extra_options: "-A Win32"
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "macOS Clang",
|
|
|
|
os: macos-latest,
|
|
|
|
build_type: "Release"
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "Linux GCC",
|
|
|
|
os: ubuntu-latest,
|
|
|
|
build_type: "Release"
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "Linux Clang",
|
|
|
|
os: ubuntu-latest,
|
|
|
|
build_type: "Release",
|
|
|
|
extra_options: "-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
|
|
|
|
}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
2020-01-07 11:17:42 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ "${{ runner.os }}" == 'Linux' ]]; then
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install libasound2-dev
|
|
|
|
fi
|
|
|
|
|
2020-01-04 13:11:09 +00:00
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2020-01-07 11:17:42 +00:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX=../build_install ${{ matrix.config.extra_options }} ..
|
2020-01-04 13:11:09 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
if [[ "${{ runner.os }}" == 'Windows' ]]; then
|
2020-01-07 11:17:42 +00:00
|
|
|
cmake --build . --target install --config ${{ matrix.config.build_type }} -- -maxcpucount -verbosity:minimal
|
2020-01-04 13:11:09 +00:00
|
|
|
else
|
2020-01-07 11:17:42 +00:00
|
|
|
cmake --build . --target install -- --jobs=2 --keep-going
|
2020-01-04 13:11:09 +00:00
|
|
|
fi
|
|
|
|
|
2020-01-07 11:17:42 +00:00
|
|
|
- name: Test
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd samples/list_midi_devices
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
declare -x PREFIX=`pwd`/../../../build_install
|
|
|
|
cmake -DCMAKE_PREFIX_PATH=${PREFIX} ${{ matrix.config.extra_options }} ..
|
|
|
|
cmake --build . --config ${{ matrix.config.build_type }}
|
|
|
|
if [[ "${{ runner.os }}" == 'macOS' ]]; then
|
|
|
|
declare -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${PREFIX}
|
|
|
|
fi
|
|
|
|
if [[ "${{ runner.os }}" == 'Windows' ]]; then
|
|
|
|
cp ${PREFIX}/bin/zmusic.dll ${{ matrix.config.build_type }}
|
|
|
|
${{ matrix.config.build_type }}/list_midi_devices.exe
|
|
|
|
else
|
|
|
|
./list_midi_devices
|
|
|
|
fi
|