100 lines
3.9 KiB
YAML
100 lines
3.9 KiB
YAML
name: "Build OpenVulkano"
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
build:
|
|
name: Build desktop
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ windows_x64, ubuntu-latest, mac_arm ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
- name: Install Vulkan SDK
|
|
if: matrix.os == 'ubuntu-latest'
|
|
uses: humbletim/install-vulkan-sdk@v1.1.1
|
|
with:
|
|
version: 1.3.250.1
|
|
cache: true
|
|
- name: Install Dev Packages
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: >
|
|
sudo apt update && sudo apt install -y extra-cmake-modules libwayland-dev fonts-ubuntu libxkbcommon-dev xorg-dev libarchive-dev libassimp-dev ninja-build glslang-tools glslang-dev unzip zip libcurl4-openssl-dev libfreetype-dev libjpeg-turbo8-dev nasm
|
|
&& sudo wget https://sourceforge.net/projects/bin2c/files/1.1/bin2c-1.1.zip && sudo unzip bin2c-1.1.zip && cd bin2c && sudo gcc -o bin2c bin2c.c && sudo mv bin2c /usr/bin && fc-cache -f -v
|
|
|
|
- name: Get cmake checks from cache
|
|
uses: actions/cache@v4
|
|
id: cache
|
|
with:
|
|
path: |
|
|
${{github.workspace}}/build/cmake_checks_cache.txt
|
|
${{github.workspace}}/build/CMakeFiles/**/CMake*.cmake
|
|
key: ${{runner.os}}-cmake-checks
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
run: |
|
|
if [ "${{ steps.cache.outputs.cache-hit }}" != "true" ]; then
|
|
cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDEPENDENCY_MIRROR_FILE="${{github.workspace}}/.gitea/workflows/DependencyMirrors.txt"
|
|
else
|
|
cmake -B "${{github.workspace}}/build" -C ${{github.workspace}}/build/cmake_checks_cache.txt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDEPENDENCY_MIRROR_FILE="${{github.workspace}}/.gitea/workflows/DependencyMirrors.txt"
|
|
fi
|
|
- name: Build
|
|
shell: bash
|
|
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
run: ctest --verbose -C ${{env.BUILD_TYPE}}
|
|
- name: Archive artifacts Windows
|
|
if: matrix.os == 'windows_x64'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: 'Artifacts-windows'
|
|
path: |
|
|
${{github.workspace}}/build/examples/${{env.BUILD_TYPE}}
|
|
${{github.workspace}}/build/tests/${{env.BUILD_TYPE}}
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
overwrite: true
|
|
- name: Archive artifacts
|
|
if: matrix.os != 'windows_x64'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: 'Artifacts-${{matrix.os}}'
|
|
path: |
|
|
${{github.workspace}}/build/examples
|
|
${{github.workspace}}/build/tests
|
|
!${{github.workspace}}/build/**/CMakeFiles
|
|
!${{github.workspace}}/build/**/*.cmake
|
|
!${{github.workspace}}/build/**/Makefile
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
overwrite: true
|
|
|
|
|
|
build_iOS:
|
|
name: Build iOS
|
|
runs-on: mac_arm
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
- name: Configure CMake
|
|
run: mkdir cmake-build && mkdir cmake-build/iOS && cd cmake-build/iOS && cmake ../.. -G Xcode -DPLATFORM=OS64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
- name: Build & Archive
|
|
run: xcodebuild -project ${{github.workspace}}/cmake-build/iOS/OpenVulkano.xcodeproj -derivedDataPath ${{github.workspace}}/cmake-build/iOS/dd -scheme OpenVulkano_Examples -configuration ${{env.BUILD_TYPE}} -archivePath ${{github.workspace}}/cmake-build/iOS/app.xcarchive -sdk iphoneos archive |