build.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. name: Build
  2. on:
  3. push:
  4. branches: [ master ]
  5. paths-ignore:
  6. - 'Docs/**'
  7. - '**.md'
  8. pull_request:
  9. branches: [ master ]
  10. paths-ignore:
  11. - 'Docs/**'
  12. - '**.md'
  13. jobs:
  14. linux-clang:
  15. runs-on: ubuntu-22.04
  16. name: Linux Clang
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. build_type: [Debug, Release, Distribution, ReleaseASAN, ReleaseUBSAN]
  21. clang_version: [clang++-12, clang++-14]
  22. double_precision: [No, Yes]
  23. steps:
  24. - name: Checkout Code
  25. uses: actions/checkout@v3
  26. - name: Configure CMake
  27. run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} -DDOUBLE_PRECISION=${{matrix.double_precision}} Build
  28. - name: Build
  29. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  30. - name: Test
  31. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  32. run: ctest --output-on-failure
  33. linux-clang-so:
  34. runs-on: ubuntu-22.04
  35. name: Linux Clang Shared Library
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. build_type: [Debug, Release, Distribution]
  40. clang_version: [clang++-14]
  41. steps:
  42. - name: Checkout Code
  43. uses: actions/checkout@v3
  44. - name: Configure CMake
  45. run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} -DBUILD_SHARED_LIBS=Yes Build
  46. - name: Build
  47. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  48. - name: Test
  49. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  50. run: ctest --output-on-failure
  51. linux-gcc:
  52. runs-on: ubuntu-22.04
  53. name: Linux GCC
  54. strategy:
  55. fail-fast: false
  56. matrix:
  57. build_type: [Debug, Release, Distribution]
  58. clang_version: [g++]
  59. steps:
  60. - name: Checkout Code
  61. uses: actions/checkout@v3
  62. - name: Configure CMake
  63. run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} Build
  64. - name: Build
  65. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  66. - name: Test
  67. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  68. run: ctest --output-on-failure
  69. msys2_mingw_gcc:
  70. runs-on: windows-latest
  71. defaults:
  72. run:
  73. shell: msys2 {0}
  74. name: MSYS2 MinGW GCC
  75. strategy:
  76. fail-fast: false
  77. matrix:
  78. build_type: [Debug, Release]
  79. steps:
  80. - name: Checkout Code
  81. uses: actions/checkout@v3
  82. - name: Setup MSYS2
  83. uses: msys2/setup-msys2@v2
  84. with:
  85. msystem: mingw64
  86. install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
  87. update: true
  88. - name: Configure CMake
  89. run: cmake -B Build/MSYS2_MinGW_GCC -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} Build
  90. - name: Build
  91. run: cmake --build Build/MSYS2_MinGW_GCC -j 2
  92. - name: Test
  93. working-directory: Build/MSYS2_MinGW_GCC
  94. run: ctest --output-on-failure
  95. msvc_cl:
  96. runs-on: windows-latest
  97. name: Visual Studio CL
  98. strategy:
  99. fail-fast: false
  100. matrix:
  101. build_type: [Debug, Release, Distribution]
  102. double_precision: [No, Yes]
  103. steps:
  104. - name: Checkout Code
  105. uses: actions/checkout@v3
  106. - name: Add msbuild to PATH
  107. uses: microsoft/[email protected]
  108. - name: Configure CMake
  109. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  110. - name: Build
  111. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  112. - name: Test
  113. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  114. run: ./UnitTests.exe
  115. msvc_cl_dll:
  116. runs-on: windows-latest
  117. name: Visual Studio CL Shared Library
  118. strategy:
  119. fail-fast: false
  120. matrix:
  121. build_type: [Debug, Release, Distribution]
  122. steps:
  123. - name: Checkout Code
  124. uses: actions/checkout@v3
  125. - name: Add msbuild to PATH
  126. uses: microsoft/[email protected]
  127. - name: Configure CMake
  128. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DBUILD_SHARED_LIBS=Yes
  129. - name: Build
  130. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  131. - name: Test
  132. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  133. run: ./UnitTests.exe
  134. msvc_cl_32_bit:
  135. runs-on: windows-latest
  136. name: Visual Studio CL 32-bit
  137. strategy:
  138. fail-fast: false
  139. matrix:
  140. build_type: [Debug, Release]
  141. steps:
  142. - name: Checkout Code
  143. uses: actions/checkout@v3
  144. - name: Add msbuild to PATH
  145. uses: microsoft/[email protected]
  146. - name: Configure CMake
  147. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_32_BIT -G "Visual Studio 17 2022" -A Win32 -DUSE_SSE4_1=OFF -DUSE_SSE4_2=OFF -DUSE_AVX=OFF -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF Build
  148. - name: Build
  149. run: msbuild Build\VS2022_CL_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  150. - name: Test
  151. working-directory: ${{github.workspace}}/Build/VS2022_CL_32_BIT/${{matrix.build_type}}
  152. run: ./UnitTests.exe
  153. msvc_cl_arm:
  154. runs-on: windows-latest
  155. name: Visual Studio CL ARM
  156. strategy:
  157. fail-fast: false
  158. matrix:
  159. build_type: [Debug, Release]
  160. steps:
  161. - name: Checkout Code
  162. uses: actions/checkout@v3
  163. - name: Add msbuild to PATH
  164. uses: microsoft/[email protected]
  165. - name: Configure CMake
  166. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 Build
  167. - name: Build
  168. run: msbuild Build\VS2022_CL_ARM\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  169. msvc_cl_arm_32_bit:
  170. runs-on: windows-latest
  171. name: Visual Studio CL ARM 32-bit
  172. strategy:
  173. fail-fast: false
  174. matrix:
  175. build_type: [Debug, Release]
  176. steps:
  177. - name: Checkout Code
  178. uses: actions/checkout@v3
  179. - name: Add msbuild to PATH
  180. uses: microsoft/[email protected]
  181. - name: Configure CMake
  182. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM_32_BIT -G "Visual Studio 17 2022" -A ARM Build
  183. - name: Build
  184. run: msbuild Build\VS2022_CL_ARM_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  185. msvc_clang:
  186. runs-on: windows-latest
  187. name: Visual Studio Clang
  188. strategy:
  189. fail-fast: false
  190. matrix:
  191. build_type: [Debug, Release, Distribution]
  192. double_precision: [No, Yes]
  193. steps:
  194. - name: Checkout Code
  195. uses: actions/checkout@v3
  196. - name: Add msbuild to PATH
  197. uses: microsoft/[email protected]
  198. - name: Configure CMake
  199. run: cmake -B ${{github.workspace}}/Build/VS2022_Clang -G "Visual Studio 17 2022" -A x64 -T ClangCL Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  200. - name: Build
  201. run: msbuild Build\VS2022_Clang\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  202. - name: Test
  203. working-directory: ${{github.workspace}}/Build/VS2022_Clang/${{matrix.build_type}}
  204. run: ./UnitTests.exe
  205. macos:
  206. runs-on: macos-latest
  207. name: macOS
  208. strategy:
  209. fail-fast: false
  210. matrix:
  211. build_type: [Debug, Release, Distribution]
  212. clang_version: [clang++]
  213. steps:
  214. - name: Checkout Code
  215. uses: actions/checkout@v3
  216. - name: Configure CMake
  217. # github macos-latest runs on a 2013 Ivy Bridge CPU so doesn't have AVX2, LZCNT, TZCNT or FMADD
  218. run: cmake -B ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_FMADD=OFF Build
  219. - name: Build
  220. run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  221. - name: Test
  222. working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}}
  223. run: ctest --output-on-failure
  224. android:
  225. runs-on: ubuntu-22.04
  226. name: Android
  227. strategy:
  228. fail-fast: false
  229. steps:
  230. - name: Checkout Code
  231. uses: actions/checkout@v3
  232. - name: Setup Java
  233. uses: actions/setup-java@v3
  234. with:
  235. distribution: 'temurin'
  236. java-version: '17'
  237. - name: Gradle Build
  238. working-directory: ${{github.workspace}}/Build/Android
  239. run: ./gradlew build --no-daemon
  240. ios:
  241. runs-on: macos-latest
  242. name: iOS
  243. strategy:
  244. fail-fast: false
  245. steps:
  246. - name: Checkout Code
  247. uses: actions/checkout@v3
  248. - name: Configure CMake
  249. run: cmake -B ${{github.workspace}}/Build/XCode_iOS -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF -DCMAKE_SYSTEM_NAME=iOS -GXcode Build
  250. - name: Build
  251. run: cmake --build ${{github.workspace}}/Build/XCode_iOS -- -sdk iphonesimulator -arch x86_64