update workflow #127
This file contains hidden or 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: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| build: | ||
| name: ${{ matrix.os }}-${{ matrix.target }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| target: native | ||
| - os: windows-latest | ||
| target: native | ||
| - os: ubuntu-latest | ||
| target: android | ||
| env: | ||
| VULKAN_SDK: ${{ env.VULKAN_SDK }} | ||
|
Check failure on line 24 in .github/workflows/cmake.yaml
|
||
| LD_LIBRARY_PATH: ${{ env.VULKAN_SDK }}/lib:${{ env.LD_LIBRARY_PATH }} | ||
| LIB: | | ||
| ${{ env.VULKAN_SDK }}\Lib | ||
| ${{ env.LIB }} | ||
| PATH: | | ||
| ${{ env.VULKAN_SDK }}\Bin | ||
| ${{ env.PATH }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Vulkan SDK | ||
| uses: jakoch/install-vulkan-sdk-action@v1 | ||
| with: | ||
| vulkan_version: 1.3.280.0 | ||
| cache: true | ||
| install_lavapipe: true | ||
| - name: Setup dependencies (Linux + Android) | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang ninja-build libomp-dev libpng-dev libx11-dev | ||
| - name: Setup dependencies (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: choco install llvm ninja cmake -y | ||
| - name: Set up Android NDK | ||
| if: matrix.target == 'android' | ||
| uses: android-actions/setup-android@v3 | ||
| with: | ||
| ndk-version: "26.2.11394342" | ||
| components: platform-tools | ||
| - name: Cache CMake build directory | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: build | ||
| key: build-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cpp', '**/*.h') }} | ||
| restore-keys: | | ||
| build-${{ runner.os }}-${{ matrix.target }}- | ||
| # Configure step | ||
| - name: Configure (Linux native) | ||
| if: matrix.target == 'native' && matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| cmake -S . -B build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_C_COMPILER=clang \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DVULKAN_SDK="$VULKAN_SDK" \ | ||
| -DCMAKE_PREFIX_PATH="$VULKAN_SDK" | ||
| - name: Configure (Windows native) | ||
| if: matrix.target == 'native' && matrix.os == 'windows-latest' | ||
| shell: pwsh | ||
| run: | | ||
| cmake -S . -B build -G Ninja ` | ||
| -DCMAKE_BUILD_TYPE=Release ` | ||
| -DCMAKE_C_COMPILER="clang.exe" ` | ||
| -DCMAKE_CXX_COMPILER="clang++.exe" ` | ||
| -DVULKAN_SDK="$Env:VULKAN_SDK" ` | ||
| -DCMAKE_PREFIX_PATH="$Env:VULKAN_SDK" | ||
| - name: Configure (Android arm64-v8a) | ||
| if: matrix.target == 'android' | ||
| env: | ||
| ANDROID_NDK: ${{ env.ANDROID_NDK_HOME }} | ||
| run: | | ||
| cmake -S . -B build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \ | ||
| -DANDROID_ABI=arm64-v8a \ | ||
| -DANDROID_PLATFORM=android-24 \ | ||
| -DVULKAN_SDK="$VULKAN_SDK" | ||
| # Build | ||
| - name: Build | ||
| run: cmake --build build --config Release | ||
| # Run tests for native only | ||
| - name: Run tests (Linux) | ||
| if: matrix.target == 'native' && matrix.os == 'ubuntu-latest' | ||
| working-directory: build | ||
| run: ctest --output-on-failure | ||
| - name: Run tests (Windows) | ||
| if: matrix.target == 'native' && matrix.os == 'windows-latest' | ||
| working-directory: build | ||
| run: ctest -C Release --output-on-failure | ||
| - name: Skip tests (Android) | ||
| if: matrix.target == 'android' | ||
| run: echo "Skipping tests for Android target" | ||