Add post and preprocessing for offline pipeline (#52) #313
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: Build Vst Host | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build_windows_configuration: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Python Dependencies | |
run: | | |
python --version | |
python -m pip install --upgrade pip | |
pip install -r ${{github.workspace}}/VstHost_Python/requirements.txt | |
pip install coveralls | |
- name: Configure CMake | |
run: | | |
mkdir build | |
cd build | |
cmake "${{github.workspace}}\VstHost_VisualC++" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_GMOCK=1 | |
cd .. | |
- name: Build C++ Code | |
run: | | |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 8 | |
- name: Run C++ Unit Tests | |
run: | | |
cd ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}} | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests.exe | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests.exe | |
- name: Run Python Unit Tests | |
run: | | |
cp ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 ${{github.workspace}}\VstHost_Python\UnitTests\ | |
cp ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/AudioHostLib.dll ${{github.workspace}}\VstHost_Python\UnitTests\ | |
cd ${{github.workspace}}/VstHost_Python | |
python -m unittest discover UnitTests "test_*.py" | |
cd ${{github.workspace}} | |
- name: Clean Up After Build | |
run: | | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests.exe | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests.exe | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/VstHost.log | |
rm -r -fo ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/data | |
# - name: Archive Build Artifacts | |
# uses: actions/upload-artifact@v1 | |
# with: | |
# name: windows_x64 | |
# path: ${{ github.workspace }}/build/bin/${{env.BUILD_TYPE}} | |
build_linux_configuration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Python Dependencies | |
run: | | |
python --version | |
python -m pip install --upgrade pip | |
pip install -r ${{github.workspace}}/VstHost_Python/requirements.txt | |
sudo apt-get install libsndfile1-dev | |
sudo apt-get install libasound2-dev | |
- name: Install Doxygen | |
run: | | |
sudo apt-get install -y doxygen | |
- name: Install Gcovr | |
run: | | |
sudo apt-get install -y gcovr | |
- name: Configure CMake | |
run: | | |
mkdir build | |
cd build | |
cmake "${{github.workspace}}\VstHost_VisualC++" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_GMOCK=1 | |
cd .. | |
- name: Build C++ Code | |
run: | | |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 8 | |
- name: Run C++ Unit Tests | |
run: | | |
cd ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}} | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests | |
cd ${{github.workspace}} | |
- name: Generate a code coverage report | |
uses: threeal/gcovr-action@main | |
with: | |
root: ${{github.workspace}} | |
excludes: | | |
.*googletest* | |
.*argparser.hpp* | |
.*json.hpp* | |
.*vst3sdk* | |
.*rtaudio* | |
fail-under-line: 80 | |
coveralls-send: true | |
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
- name: Run Python Unit Tests | |
run: | | |
cp -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 ${{github.workspace}}/VstHost_Python/UnitTests/adelay.vst3 | |
cp ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/libAudioHostLib.so ${{github.workspace}}/VstHost_Python/UnitTests/ | |
python --version | |
cd ${{github.workspace}}/VstHost_Python | |
python -m unittest discover UnitTests "test_*.py" | |
cd ${{github.workspace}} | |
- name: Clean Up After Build | |
run: | | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests | |
rm -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/VstHost.log | |
rm -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/data | |
# - name: Archive Build Artifacts | |
# uses: actions/upload-artifact@v1 | |
# with: | |
# name: linux_x64 | |
# path: ${{ github.workspace }}/build/bin/${{env.BUILD_TYPE}} | |
build_mac_os_configuration: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Python Dependencies | |
run: | | |
python --version | |
python -m pip install --upgrade pip | |
pip install -r ${{github.workspace}}/VstHost_Python/requirements.txt | |
- name: Install Doxygen | |
run: | | |
brew install doxygen | |
- name: Configure CMake | |
run: | | |
mkdir build | |
cd build | |
cmake -G Xcode ${{github.workspace}}/VstHost_VisualC++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=gcc -DBUILD_GMOCK=1 | |
cd .. | |
- name: Build C++ Code | |
run: | | |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 8 --resolve-package-references on | |
- name: Run C++ Unit Tests | |
run: | | |
cd ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}} | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests | |
${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests | |
- name: Run Python Unit Tests | |
run: | | |
cp -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 ${{github.workspace}}/VstHost_Python/UnitTests/adelay.vst3 | |
cp ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/libAudioHostLib.dylib ${{github.workspace}}/VstHost_Python/UnitTests/ | |
cd ${{github.workspace}}/VstHost_Python | |
python --version | |
python -m unittest discover UnitTests "test_*.py" | |
cd ${{github.workspace}} | |
- name: Clean Up After Build | |
run: | | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/ApiUnitTests | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/OfflineToolsUnitTests | |
rm -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/adelay.vst3 | |
rm ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/VstHost.log | |
rm -fr ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/data | |
# - name: Archive Build Artifacts | |
# uses: actions/upload-artifact@v1 | |
# with: | |
# name: mac_os | |
# path: ${{ github.workspace }}/build/bin/${{env.BUILD_TYPE}} | |
build_android_configuration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: nttld/setup-ndk@v1 | |
id: install-ndk | |
with: | |
ndk-version: r24 | |
add-to-path: false | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v1.13 | |
with: | |
cmake-version: '3.19.x' | |
- name: Install Audio Drivers | |
run: | | |
sudo apt-get install libasound2-dev | |
- name: Use cmake | |
run: cmake --version | |
- name: Configure CMake and Build C++ .so for armeabi-v7a | |
run: | | |
export ANDROID_NDK_PATH=${{ steps.install-ndk.outputs.ndk-path }} | |
cmake "${{github.workspace}}\VstHost_VisualC++" -B build_armeabi-v7a -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DANDROID_PLATFORM=android-28 -D ANDROID_ABI=armeabi-v7a -DANDROID_BUILD=True | |
cd build_armeabi-v7a | |
${{ steps.install-ndk.outputs.ndk-path }}/prebuilt/linux-x86_64/bin/make | |
cd .. | |
- name: Configure CMake and Build C++ .so for arm64-v8a | |
run: | | |
export ANDROID_NDK_PATH=${{ steps.install-ndk.outputs.ndk-path }} | |
cmake "${{github.workspace}}\VstHost_VisualC++" -B build_arm64-v8a -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DANDROID_PLATFORM=android-28 -D ANDROID_ABI=arm64-v8a -DANDROID_BUILD=True | |
cd build_arm64-v8a | |
${{ steps.install-ndk.outputs.ndk-path }}/prebuilt/linux-x86_64/bin/make | |
cd .. | |
- name: Configure CMake and Build C++ .so for x86 | |
run: | | |
export ANDROID_NDK_PATH=${{ steps.install-ndk.outputs.ndk-path }} | |
cmake "${{github.workspace}}\VstHost_VisualC++" -B build_x86 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DANDROID_PLATFORM=android-28 -D ANDROID_ABI=x86 -DANDROID_BUILD=True | |
cd build_x86 | |
${{ steps.install-ndk.outputs.ndk-path }}/prebuilt/linux-x86_64/bin/make | |
cd .. | |
- name: Configure CMake and Build C++ .so for x86_64 | |
run: | | |
export ANDROID_NDK_PATH=${{ steps.install-ndk.outputs.ndk-path }} | |
cmake "${{github.workspace}}\VstHost_VisualC++" -B build_x86_64 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DANDROID_PLATFORM=android-28 -D ANDROID_ABI=x86_64 -DANDROID_BUILD=True | |
cd build_x86_64 | |
${{ steps.install-ndk.outputs.ndk-path }}/prebuilt/linux-x86_64/bin/make | |
cd .. | |
ls -la | |
- name: Prepare Setup for Android Build | |
run: | | |
mkdir ${{github.workspace}}/VstHost_Android/AndroidPack | |
cp -rv build_armeabi-v7a/bin/${{env.BUILD_TYPE}}/AndroidPack/ ${{github.workspace}}/VstHost_Android/ | |
cp -rv build_arm64-v8a/bin/${{env.BUILD_TYPE}}/AndroidPack/ ${{github.workspace}}/VstHost_Android/ | |
cp -rv build_x86/bin/${{env.BUILD_TYPE}}/AndroidPack/ ${{github.workspace}}/VstHost_Android/ | |
cp -rv build_x86_64/bin/${{env.BUILD_TYPE}}/AndroidPack/ ${{github.workspace}}/VstHost_Android/ | |
cp -rv build_x86_64/VST3/${{env.BUILD_TYPE}} ${{github.workspace}}/VstHost_Android/app/src/main/assets | |
cp -v VstHost_VisualC++/modules/UnitTests/data/sine_440.wav ${{github.workspace}}/VstHost_Android/app/src/main/assets/ | |
cp -v VstHost_VisualC++/modules/UnitTests/data/sine_440_output_ref.wav ${{github.workspace}}/VstHost_Android/app/src/main/assets/ | |
cd VstHost_Android | |
chmod +x gradlew | |
- name: Run Instrumentation Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 28 | |
arch: x86_64 | |
profile: Nexus 6 | |
cmake: 3.22.1 | |
working-directory: ${{github.workspace}}/VstHost_Android | |
script: | | |
ls -la ${{github.workspace}}/VstHost_Android/app/src/main/assets/ | |
./gradlew connectedCheck |