|
| 1 | +name: Build Code |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + types: [opened] |
| 7 | + |
| 8 | +env: |
| 9 | + VMA_VULKAN_VERSION: "1.3.283.0" |
| 10 | + VMA_VULKAN_SDK_PATH: "$GITHUB_WORKSPACE/../vulkan_sdk/" |
| 11 | + VMA_VULKAN_SDK_CHECKSUM_LINUX: "8005e2cf3e89c80cbe1c0d0a259c88248de3257b4fc6fdefb47409edb3e43ecb" |
| 12 | + VMA_VULKAN_SDK_CHECKSUM_WINDOWS: "811fcb9b43d09248520b2f38ae9a3763fc81df950fdab874f23bd762b07a9b12" |
| 13 | + |
| 14 | +jobs: |
| 15 | + windows: |
| 16 | + name: ${{ matrix.config.name }} |
| 17 | + runs-on: windows-latest |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + config: |
| 22 | + - { |
| 23 | + name: "Windows MSVC (Debug)", |
| 24 | + compiler: "msvc", |
| 25 | + cc: "cl", cxx: "cl", |
| 26 | + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64', |
| 27 | + build_type: "Debug", |
| 28 | + cmake_build_options: "--config Debug", |
| 29 | + } |
| 30 | + - { |
| 31 | + name: "Windows MSVC (Release)", |
| 32 | + compiler: "msvc", |
| 33 | + cc: "cl", cxx: "cl", |
| 34 | + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64', |
| 35 | + build_type: "Release", |
| 36 | + cmake_build_options: "--config Release", |
| 37 | + } |
| 38 | + - { |
| 39 | + name: "Windows Clang (Debug)", |
| 40 | + compiler: "clang", |
| 41 | + cc: "clang-cl", cxx: "clang-cl", |
| 42 | + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"', |
| 43 | + build_type: "Debug", |
| 44 | + cmake_build_options: "--config Debug", |
| 45 | + } |
| 46 | + - { |
| 47 | + name: "Windows Clang (Release)", |
| 48 | + compiler: "clang", |
| 49 | + cc: "clang-cl", cxx: "clang-cl", |
| 50 | + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"', |
| 51 | + build_type: "Release", |
| 52 | + cmake_build_options: "--config Release", |
| 53 | + } |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Configure LLVM |
| 60 | + if: matrix.config.compiler == 'clang' |
| 61 | + shell: pwsh |
| 62 | + run: | |
| 63 | + choco upgrade --no-progress llvm |
| 64 | + curl -fsSL -o "LLVM_VS2017.zip" "https://github.com/zufuliu/llvm-utils/releases/download/v23.05/LLVM_VS2017.zip" |
| 65 | + 7z x -y "LLVM_VS2017.zip" >NUL |
| 66 | + LLVM_VS2017\install.bat |
| 67 | +
|
| 68 | + - name: Install Vulkan SDK |
| 69 | + shell: pwsh |
| 70 | + run: | |
| 71 | + curl -LS -o vulkansdk.exe https://sdk.lunarg.com/sdk/download/${{ env.VMA_VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VMA_VULKAN_VERSION }}-Installer.exe |
| 72 | + 7z x vulkansdk.exe -o"${{ env.VMA_VULKAN_SDK_PATH }}" |
| 73 | +
|
| 74 | + - name: Configure CMake |
| 75 | + shell: pwsh |
| 76 | + run: | |
| 77 | + $env:CC="${{ matrix.config.cc }}" |
| 78 | + $env:CXX="${{ matrix.config.cxx }}" |
| 79 | + $env:Path += ";${{ env.VMA_VULKAN_SDK_PATH }}\;${{ env.VMA_VULKAN_SDK_PATH }}\Bin\" |
| 80 | + $env:VULKAN_SDK="${{ env.VMA_VULKAN_SDK_PATH }}" |
| 81 | + cmake . ` |
| 82 | + -Bbuild ` |
| 83 | + -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ` |
| 84 | + -DVMA_BUILD_SAMPLES=ON ` |
| 85 | + ${{ matrix.config.cmake_configure_options }} |
| 86 | +
|
| 87 | + - name: Build |
| 88 | + shell: pwsh |
| 89 | + run: | |
| 90 | + cmake --build build ${{ matrix.config.cmake_build_options }} |
| 91 | +
|
| 92 | + - name: Prepare Build Artifacts |
| 93 | + shell: pwsh |
| 94 | + run: | |
| 95 | + 7z a -tzip "build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}" ./build/* |
| 96 | +
|
| 97 | + - name: Upload Build Artifacts |
| 98 | + uses: actions/upload-artifact@v4 |
| 99 | + with: |
| 100 | + name: build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }} |
| 101 | + path: build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.zip |
| 102 | + |
| 103 | + - name: Prepare Nightly Artifacts |
| 104 | + shell: pwsh |
| 105 | + run: | |
| 106 | + mkdir artifacts |
| 107 | + cp -r ./build/src/${{ matrix.config.build_type }}/VmaSample.exe artifacts |
| 108 | + mkdir -P ./artifacts/shaders |
| 109 | + cp -r ./build/src/Shaders/*.spv ./artifacts/shaders/ |
| 110 | + 7z a -tzip "nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}" ./artifacts/* |
| 111 | +
|
| 112 | + - name: Upload Nightly Artifacts |
| 113 | + uses: actions/upload-artifact@v4 |
| 114 | + with: |
| 115 | + name: nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }} |
| 116 | + path: nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.zip |
| 117 | + retention-days: 7 |
0 commit comments