build.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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-latest
  16. name: Linux Clang
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. build_type: [Debug, Release, Distribution, ReleaseASAN, ReleaseUBSAN]
  21. clang_version: [clang++-13, clang++-14]
  22. double_precision: [No, Yes]
  23. steps:
  24. - name: Checkout Code
  25. uses: actions/checkout@v4
  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-latest
  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@v4
  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-latest
  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@v4
  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. linux-gcc-so:
  70. runs-on: ubuntu-latest
  71. name: Linux GCC Shared Library
  72. strategy:
  73. fail-fast: false
  74. matrix:
  75. build_type: [Debug, Release, Distribution]
  76. clang_version: [g++]
  77. steps:
  78. - name: Checkout Code
  79. uses: actions/checkout@v4
  80. - name: Configure CMake
  81. 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
  82. - name: Build
  83. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  84. - name: Test
  85. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  86. run: ctest --output-on-failure
  87. msys2_mingw_gcc:
  88. runs-on: windows-latest
  89. defaults:
  90. run:
  91. shell: msys2 {0}
  92. name: MSYS2 MinGW GCC
  93. strategy:
  94. fail-fast: false
  95. matrix:
  96. build_type: [Debug, Release]
  97. steps:
  98. - name: Checkout Code
  99. uses: actions/checkout@v4
  100. - name: Setup MSYS2
  101. uses: msys2/setup-msys2@v2
  102. with:
  103. msystem: mingw64
  104. install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
  105. update: true
  106. - name: Configure CMake
  107. run: cmake -B Build/MSYS2_MinGW_GCC -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} Build
  108. - name: Build
  109. run: cmake --build Build/MSYS2_MinGW_GCC -j 2
  110. - name: Test
  111. working-directory: Build/MSYS2_MinGW_GCC
  112. run: ctest --output-on-failure
  113. msvc_cl:
  114. runs-on: windows-latest
  115. name: Visual Studio CL
  116. strategy:
  117. fail-fast: false
  118. matrix:
  119. build_type: [Debug, Release, Distribution]
  120. double_precision: [No, Yes]
  121. steps:
  122. - name: Checkout Code
  123. uses: actions/checkout@v4
  124. - name: Add msbuild to PATH
  125. uses: microsoft/[email protected]
  126. - name: Configure CMake
  127. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  128. - name: Build
  129. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  130. - name: Test
  131. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  132. run: ./UnitTests.exe
  133. msvc_cl_dll:
  134. runs-on: windows-latest
  135. name: Visual Studio CL Shared Library
  136. strategy:
  137. fail-fast: false
  138. matrix:
  139. build_type: [Debug, Release, Distribution]
  140. steps:
  141. - name: Checkout Code
  142. uses: actions/checkout@v4
  143. - name: Add msbuild to PATH
  144. uses: microsoft/[email protected]
  145. - name: Configure CMake
  146. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DBUILD_SHARED_LIBS=Yes
  147. - name: Build
  148. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  149. - name: Test
  150. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  151. run: ./UnitTests.exe
  152. msvc_cl_32_bit:
  153. runs-on: windows-latest
  154. name: Visual Studio CL 32-bit
  155. strategy:
  156. fail-fast: false
  157. matrix:
  158. build_type: [Debug, Release]
  159. steps:
  160. - name: Checkout Code
  161. uses: actions/checkout@v4
  162. - name: Add msbuild to PATH
  163. uses: microsoft/[email protected]
  164. - name: Configure CMake
  165. 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
  166. - name: Build
  167. run: msbuild Build\VS2022_CL_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  168. - name: Test
  169. working-directory: ${{github.workspace}}/Build/VS2022_CL_32_BIT/${{matrix.build_type}}
  170. run: ./UnitTests.exe
  171. msvc_cl_arm:
  172. runs-on: windows-latest
  173. name: Visual Studio CL ARM
  174. strategy:
  175. fail-fast: false
  176. matrix:
  177. build_type: [Debug, Release]
  178. steps:
  179. - name: Checkout Code
  180. uses: actions/checkout@v4
  181. - name: Add msbuild to PATH
  182. uses: microsoft/[email protected]
  183. - name: Configure CMake
  184. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 Build
  185. - name: Build
  186. run: msbuild Build\VS2022_CL_ARM\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  187. msvc_cl_arm_32_bit:
  188. runs-on: windows-latest
  189. name: Visual Studio CL ARM 32-bit
  190. strategy:
  191. fail-fast: false
  192. matrix:
  193. build_type: [Debug, Release]
  194. steps:
  195. - name: Checkout Code
  196. uses: actions/checkout@v4
  197. - name: Add msbuild to PATH
  198. uses: microsoft/[email protected]
  199. - name: Configure CMake
  200. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM_32_BIT -G "Visual Studio 17 2022" -A ARM Build
  201. - name: Build
  202. run: msbuild Build\VS2022_CL_ARM_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  203. msvc_clang:
  204. runs-on: windows-latest
  205. name: Visual Studio Clang
  206. strategy:
  207. fail-fast: false
  208. matrix:
  209. build_type: [Debug, Release, Distribution]
  210. double_precision: [No, Yes]
  211. steps:
  212. - name: Checkout Code
  213. uses: actions/checkout@v4
  214. - name: Add msbuild to PATH
  215. uses: microsoft/[email protected]
  216. - name: Configure CMake
  217. run: cmake -B ${{github.workspace}}/Build/VS2022_Clang -G "Visual Studio 17 2022" -A x64 -T ClangCL Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  218. - name: Build
  219. run: msbuild Build\VS2022_Clang\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  220. - name: Test
  221. working-directory: ${{github.workspace}}/Build/VS2022_Clang/${{matrix.build_type}}
  222. run: ./UnitTests.exe
  223. macos:
  224. runs-on: macos-latest
  225. name: macOS
  226. strategy:
  227. fail-fast: false
  228. matrix:
  229. build_type: [Debug, Release, Distribution]
  230. clang_version: [clang++]
  231. steps:
  232. - name: Checkout Code
  233. uses: actions/checkout@v4
  234. - name: Configure CMake
  235. # github macos-latest runs on a 2013 Ivy Bridge CPU so doesn't have AVX2, LZCNT, TZCNT or FMADD
  236. 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
  237. - name: Build
  238. run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  239. - name: Test
  240. working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}}
  241. run: ctest --output-on-failure
  242. android:
  243. runs-on: ubuntu-latest
  244. name: Android
  245. strategy:
  246. fail-fast: false
  247. steps:
  248. - name: Checkout Code
  249. uses: actions/checkout@v4
  250. - name: Setup Java
  251. uses: actions/setup-java@v4
  252. with:
  253. distribution: 'temurin'
  254. java-version: '17'
  255. - name: Gradle Build
  256. working-directory: ${{github.workspace}}/Build/Android
  257. run: ./gradlew build --no-daemon
  258. ios:
  259. runs-on: macos-latest
  260. name: iOS
  261. strategy:
  262. fail-fast: false
  263. steps:
  264. - name: Checkout Code
  265. uses: actions/checkout@v4
  266. - name: Configure CMake
  267. run: cmake -B ${{github.workspace}}/Build/XCode_iOS -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF -DCMAKE_SYSTEM_NAME=iOS -GXcode Build
  268. - name: Build
  269. run: cmake --build ${{github.workspace}}/Build/XCode_iOS -- -sdk iphonesimulator -arch x86_64