build.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. name: build
  2. on:
  3. push: {}
  4. pull_request: {}
  5. schedule:
  6. - cron: '0 9 * * *'
  7. jobs:
  8. Windows:
  9. runs-on: windows-2019
  10. env:
  11. MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
  12. # Until gh-actions allow us to use env variables inside other env variables (because we need %GITHUB_WORKSPACE%) we have to use relative path to imgui/examples/example_name directory.
  13. SDL2_DIR: ..\..\SDL2-devel-2.0.10-VC\SDL2-2.0.10\
  14. VULKAN_SDK: ..\..\vulkan-sdk-1.1.121.2\
  15. steps:
  16. - uses: actions/checkout@v1
  17. with:
  18. fetch-depth: 1
  19. - name: Install Dependencies
  20. shell: powershell
  21. run: |
  22. Invoke-WebRequest -Uri "https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip" -OutFile "SDL2-devel-2.0.10-VC.zip"
  23. Expand-Archive -Path SDL2-devel-2.0.10-VC.zip
  24. Invoke-WebRequest -Uri "https://github.com/ocornut/imgui/files/3789205/vulkan-sdk-1.1.121.2.zip" -OutFile vulkan-sdk-1.1.121.2.zip
  25. Expand-Archive -Path vulkan-sdk-1.1.121.2.zip
  26. - name: Fix Projects
  27. shell: powershell
  28. run: |
  29. # WARNING: This will need updating if toolset/sdk change in project files!
  30. gci -recurse -filter "*.vcxproj" | ForEach-Object {
  31. # Fix SDK and toolset for most samples.
  32. (Get-Content $_.FullName) -Replace "<PlatformToolset>v110</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName
  33. (Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName
  34. # Fix SDK and toolset for samples that require newer SDK/toolset. At the moment it is only dx12.
  35. (Get-Content $_.FullName) -Replace "<PlatformToolset>v140</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName
  36. (Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName
  37. }
  38. # Not using matrix here because it would inflate job count too much. Check out and setup is done for every job and that makes build times way too long.
  39. - name: Build Win32 example_glfw_opengl2
  40. shell: cmd
  41. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  42. - name: Build Win32 example_glfw_opengl3
  43. shell: cmd
  44. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  45. if: github.event_name == 'schedule'
  46. - name: Build Win32 example_glfw_vulkan
  47. shell: cmd
  48. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  49. if: github.event_name == 'schedule'
  50. - name: Build Win32 example_sdl_vulkan
  51. shell: cmd
  52. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  53. if: github.event_name == 'schedule'
  54. - name: Build Win32 example_sdl_opengl2
  55. shell: cmd
  56. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  57. if: github.event_name == 'schedule'
  58. - name: Build Win32 example_sdl_opengl3
  59. shell: cmd
  60. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  61. - name: Build Win32 example_sdl_directx11
  62. shell: cmd
  63. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_directx11/example_sdl_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  64. if: github.event_name == 'schedule'
  65. - name: Build Win32 example_win32_directx9
  66. shell: cmd
  67. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  68. - name: Build Win32 example_win32_directx10
  69. shell: cmd
  70. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  71. - name: Build Win32 example_win32_directx11
  72. shell: cmd
  73. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release'
  74. if: github.event_name == 'schedule'
  75. - name: Build x64 example_glfw_opengl2
  76. shell: cmd
  77. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release'
  78. if: github.event_name == 'schedule'
  79. - name: Build x64 example_glfw_opengl3
  80. shell: cmd
  81. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release'
  82. - name: Build x64 example_glfw_vulkan
  83. shell: cmd
  84. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
  85. - name: Build x64 example_sdl_vulkan
  86. shell: cmd
  87. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
  88. if: github.event_name == 'schedule'
  89. - name: Build x64 example_sdl_opengl2
  90. shell: cmd
  91. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release'
  92. if: github.event_name == 'schedule'
  93. - name: Build x64 example_sdl_opengl3
  94. shell: cmd
  95. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release'
  96. if: github.event_name == 'schedule'
  97. - name: Build x64 example_sdl_directx11
  98. shell: cmd
  99. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl_directx11/example_sdl_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release'
  100. - name: Build x64 example_win32_directx9
  101. shell: cmd
  102. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=x64 /p:Configuration=Release'
  103. if: github.event_name == 'schedule'
  104. - name: Build x64 example_win32_directx10
  105. shell: cmd
  106. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=x64 /p:Configuration=Release'
  107. if: github.event_name == 'schedule'
  108. - name: Build x64 example_win32_directx11
  109. shell: cmd
  110. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release'
  111. if: github.event_name == 'schedule'
  112. - name: Build x64 example_win32_directx12
  113. shell: cmd
  114. run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
  115. Linux:
  116. runs-on: ubuntu-18.04
  117. steps:
  118. - uses: actions/checkout@v1
  119. with:
  120. fetch-depth: 1
  121. - name: Install Dependencies
  122. run: |
  123. sudo apt-get update
  124. sudo apt-get install -y libglfw3-dev libsdl2-dev
  125. - name: Build example_null
  126. run: make -C examples/example_null
  127. - name: Build example_glfw_opengl2
  128. run: make -C examples/example_glfw_opengl2
  129. - name: Build example_glfw_opengl3
  130. run: make -C examples/example_glfw_opengl3
  131. if: github.event_name == 'schedule'
  132. - name: Build example_sdl_opengl2
  133. run: make -C examples/example_sdl_opengl2
  134. if: github.event_name == 'schedule'
  135. - name: Build example_sdl_opengl3
  136. run: make -C examples/example_sdl_opengl3
  137. MacOS:
  138. runs-on: macOS-10.14
  139. steps:
  140. - uses: actions/checkout@v1
  141. with:
  142. fetch-depth: 1
  143. - name: Install Dependencies
  144. run: |
  145. brew install glfw3
  146. brew install sdl2
  147. - name: Build example_null
  148. run: make -C examples/example_null
  149. - name: Build example_glfw_opengl2
  150. run: make -C examples/example_glfw_opengl2
  151. - name: Build example_glfw_opengl3
  152. run: make -C examples/example_glfw_opengl3
  153. if: github.event_name == 'schedule'
  154. - name: Build example_glfw_metal
  155. run: make -C examples/example_glfw_metal
  156. - name: Build example_sdl_opengl2
  157. run: make -C examples/example_sdl_opengl2
  158. if: github.event_name == 'schedule'
  159. - name: Build example_sdl_opengl3
  160. run: make -C examples/example_sdl_opengl3
  161. - name: Build example_apple_metal
  162. run: xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos
  163. - name: Build example_apple_opengl2
  164. run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
  165. iOS:
  166. runs-on: macOS-10.14
  167. steps:
  168. - uses: actions/checkout@v1
  169. with:
  170. fetch-depth: 1
  171. - name: Build example_apple_metal
  172. run: |
  173. # Code signing is required, but we disable it because it is irrelevant for CI builds.
  174. xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  175. Emscripten:
  176. runs-on: ubuntu-18.04
  177. steps:
  178. - uses: actions/checkout@v1
  179. with:
  180. fetch-depth: 1
  181. - name: Install Dependencies
  182. run: |
  183. wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  184. tar -xvf master.tar.gz
  185. emsdk-master/emsdk update
  186. emsdk-master/emsdk install latest-fastcomp
  187. emsdk-master/emsdk activate latest-fastcomp
  188. - name: Build example_emscripten
  189. run: |
  190. source emsdk-master/emsdk_env.sh
  191. make -C examples/example_emscripten