Fix tests; #1315
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 | |
on: [push, pull_request] | |
env: | |
CMAKE_BUILD_TYPE: ${{ github.event_name == 'pull_request' && 'Debug' || 'Release' }} | |
jobs: | |
windows: | |
name: Windows | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Configure | |
run: cmake -B build -D LOVR_VERSION_HASH=%GITHUB_SHA:~0,6% | |
- name: Build | |
run: cmake --build build --config %CMAKE_BUILD_TYPE% | |
- name: Test | |
run: build\%CMAKE_BUILD_TYPE%\lovr test | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lovr.exe | |
path: | | |
build/Release/lovr.exe | |
build/Release/lovrc.bat | |
build/Release/*.dll | |
linux: | |
name: Linux | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Update Packages | |
run: sudo apt update | |
- name: Install Packages | |
run: sudo apt install -y xorg-dev libx11-xcb-dev libxcb-glx0-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-xkb-dev libfuse2 libcurl4-openssl-dev libssl-dev | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Init | |
run: cmake -B build -D LOVR_BUILD_BUNDLE=ON -D LOVR_VERSION_HASH=${GITHUB_SHA::6} | |
- name: Build | |
run: cmake --build build -j | |
- name: Test | |
run: ./build/bin/lovr test | |
- name: AppImage | |
run: > | |
curl -sOL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && | |
chmod +x ./appimagetool-x86_64.AppImage && | |
./appimagetool-x86_64.AppImage build/bin && | |
mv LÖVR-x86_64.AppImage lovr-x86_64.AppImage | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lovr.appimage | |
path: lovr-x86_64.AppImage | |
android: | |
name: Android | |
strategy: | |
matrix: | |
abi: [arm64-v8a, x86_64] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Update Packages | |
run: sudo apt update | |
- name: Install Packages | |
run: sudo apt install -y glslang-tools | |
- name: Install Android 29 | |
run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-29" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Init | |
run: > | |
mkdir build && | |
cd build && | |
keytool | |
-genkey | |
-dname 'cn=Unknown, ou=Unknown, o=Unknown, l=Unknown, st=Unknown, c=Unknown' | |
-keystore key.keystore | |
-keypass hunter2 | |
-storepass hunter2 | |
-alias key | |
-keyalg RSA | |
-keysize 2048 | |
-validity 10000 && | |
cmake .. | |
-D CMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake | |
-D ANDROID_SDK=$ANDROID_HOME | |
-D ANDROID_ABI=${{ matrix.abi }} | |
-D ANDROID_STL=c++_shared | |
-D ANDROID_NATIVE_API_LEVEL=29 | |
-D ANDROID_BUILD_TOOLS_VERSION=34.0.0 | |
-D ANDROID_KEYSTORE=key.keystore | |
-D ANDROID_KEYSTORE_PASS=pass:hunter2 | |
-D LOVR_VERSION_HASH=${GITHUB_SHA::6} | |
- name: Build | |
run: cmake --build build | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.abi == 'arm64-v8a' && 'lovr.apk' || 'lovr-x64.apk' }} | |
path: build/lovr.apk | |
macos: | |
name: macOS | |
runs-on: macos-latest | |
steps: | |
- name: Install Wulkan | |
env: | |
VKV: 1.3.275.0 | |
run: | | |
curl -sOL https://sdk.lunarg.com/sdk/download/$VKV/mac/vulkansdk-macos-$VKV.dmg?Human=true | |
hdiutil attach vulkansdk-macos-$VKV.dmg | |
cp -R /Volumes/vulkansdk-macos-$VKV . | |
hdiutil detach /Volumes/vulkansdk-macos-$VKV | |
export VULKAN_SDK=${{ runner.temp }}/vulkan && echo "VULKAN_SDK=$VULKAN_SDK/macOS" >> $GITHUB_ENV | |
sudo vulkansdk-macos-$VKV/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $VULKAN_SDK --accept-licenses --default-answer --confirm-command install | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Init | |
run: cmake -B build -D LOVR_BUILD_BUNDLE=ON -D LOVR_VERSION_HASH=${GITHUB_SHA::6} | |
- name: Build | |
run: cmake --build build -j | |
- name: Test | |
run: ./build/lovr.app/Contents/MacOS/lovr test | |
- name: Package | |
run: > | |
cp $VULKAN_SDK/lib/libvulkan.1.3.275.dylib build/lovr.app/Contents/MacOS/libvulkan.1.dylib && | |
cp $VULKAN_SDK/lib/libMoltenVK.dylib build/lovr.app/Contents/MacOS && | |
mkdir -p build/lovr.app/Contents/Resources/vulkan/icd.d && | |
cp $VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json build/lovr.app/Contents/Resources/vulkan/icd.d && | |
sed -i '' 's|../../../lib/libMoltenVK.dylib|../../../MacOS/libMoltenVK.dylib|' build/lovr.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json && | |
ditto -c -k --keepParent build/lovr.app lovr.zip | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lovr.app | |
path: lovr.zip |