build.yml 11 KB

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