build.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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-clang-use-std-vector:
  74. runs-on: ubuntu-latest
  75. name: Linux Clang using std::vector
  76. strategy:
  77. fail-fast: false
  78. matrix:
  79. build_type: [Debug, ReleaseASAN]
  80. clang_version: [clang++-14]
  81. double_precision: [Yes]
  82. steps:
  83. - name: Checkout Code
  84. uses: actions/checkout@v4
  85. - name: Configure CMake
  86. 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}} -DUSE_STD_VECTOR=ON Build
  87. - name: Build
  88. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  89. - name: Test
  90. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  91. run: ctest --output-on-failure --verbose
  92. linux-gcc:
  93. runs-on: ubuntu-latest
  94. name: Linux GCC
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. build_type: [Debug, Release, Distribution]
  99. clang_version: [g++]
  100. steps:
  101. - name: Checkout Code
  102. uses: actions/checkout@v4
  103. - name: Configure CMake
  104. 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
  105. - name: Build
  106. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  107. - name: Test
  108. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  109. run: ctest --output-on-failure --verbose
  110. linux-gcc-so:
  111. runs-on: ubuntu-latest
  112. name: Linux GCC Shared Library
  113. strategy:
  114. fail-fast: false
  115. matrix:
  116. build_type: [Debug, Release, Distribution]
  117. clang_version: [g++]
  118. steps:
  119. - name: Checkout Code
  120. uses: actions/checkout@v4
  121. - name: Configure CMake
  122. 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
  123. - name: Build
  124. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  125. - name: Test
  126. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
  127. run: ctest --output-on-failure --verbose
  128. msys2_mingw_gcc:
  129. runs-on: windows-latest
  130. defaults:
  131. run:
  132. shell: msys2 {0}
  133. name: MSYS2 MinGW GCC
  134. strategy:
  135. fail-fast: false
  136. matrix:
  137. build_type: [Debug, Release]
  138. steps:
  139. - name: Checkout Code
  140. uses: actions/checkout@v4
  141. - name: Setup MSYS2
  142. uses: msys2/setup-msys2@v2
  143. with:
  144. msystem: mingw64
  145. install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
  146. update: true
  147. - name: Configure CMake
  148. run: cmake -B Build/MSYS2_MinGW_GCC -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} Build
  149. - name: Build
  150. run: cmake --build Build/MSYS2_MinGW_GCC -j 2
  151. - name: Test
  152. working-directory: Build/MSYS2_MinGW_GCC
  153. run: ctest --output-on-failure --verbose
  154. msvc_cl:
  155. runs-on: windows-latest
  156. name: Visual Studio CL
  157. strategy:
  158. fail-fast: false
  159. matrix:
  160. build_type: [Debug, Release, Distribution]
  161. double_precision: [No, Yes]
  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 -DDOUBLE_PRECISION=${{matrix.double_precision}}
  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_no_object_stream:
  175. runs-on: windows-latest
  176. name: Visual Studio CL - No Object Stream
  177. strategy:
  178. fail-fast: false
  179. matrix:
  180. build_type: [Debug, Distribution]
  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 -G "Visual Studio 17 2022" -A x64 Build -DENABLE_OBJECT_STREAM=NO
  188. - name: Build
  189. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  190. - name: Test
  191. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  192. run: ./UnitTests.exe
  193. msvc_cl_dll:
  194. runs-on: windows-latest
  195. name: Visual Studio CL Shared Library
  196. strategy:
  197. fail-fast: false
  198. matrix:
  199. build_type: [Debug, Release, Distribution]
  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 -G "Visual Studio 17 2022" -A x64 Build -DBUILD_SHARED_LIBS=Yes
  207. - name: Build
  208. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  209. - name: Test
  210. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  211. run: ./UnitTests.exe
  212. msvc_cl_32_bit:
  213. runs-on: windows-latest
  214. name: Visual Studio CL 32-bit
  215. strategy:
  216. fail-fast: false
  217. matrix:
  218. build_type: [Debug, Release]
  219. steps:
  220. - name: Checkout Code
  221. uses: actions/checkout@v4
  222. - name: Add msbuild to PATH
  223. uses: microsoft/setup-msbuild@v2
  224. - name: Configure CMake
  225. 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
  226. - name: Build
  227. run: msbuild Build\VS2022_CL_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  228. - name: Test
  229. working-directory: ${{github.workspace}}/Build/VS2022_CL_32_BIT/${{matrix.build_type}}
  230. run: ./UnitTests.exe
  231. msvc_cl_arm:
  232. runs-on: windows-latest
  233. name: Visual Studio CL ARM
  234. strategy:
  235. fail-fast: false
  236. matrix:
  237. build_type: [Debug, Release]
  238. steps:
  239. - name: Checkout Code
  240. uses: actions/checkout@v4
  241. - name: Add msbuild to PATH
  242. uses: microsoft/setup-msbuild@v2
  243. - name: Configure CMake
  244. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 Build
  245. - name: Build
  246. run: msbuild Build\VS2022_CL_ARM\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  247. msvc_cl_arm_32_bit:
  248. runs-on: windows-latest
  249. name: Visual Studio CL ARM 32-bit
  250. strategy:
  251. fail-fast: false
  252. matrix:
  253. build_type: [Debug, Release]
  254. steps:
  255. - name: Checkout Code
  256. uses: actions/checkout@v4
  257. - name: Add msbuild to PATH
  258. uses: microsoft/setup-msbuild@v2
  259. - name: Configure CMake
  260. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM_32_BIT -G "Visual Studio 17 2022" -A ARM Build
  261. - name: Build
  262. run: msbuild Build\VS2022_CL_ARM_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  263. msvc_clang:
  264. runs-on: windows-latest
  265. name: Visual Studio Clang
  266. strategy:
  267. fail-fast: false
  268. matrix:
  269. build_type: [Debug, Release, Distribution]
  270. double_precision: [No, Yes]
  271. steps:
  272. - name: Checkout Code
  273. uses: actions/checkout@v4
  274. - name: Add msbuild to PATH
  275. uses: microsoft/setup-msbuild@v2
  276. - name: Configure CMake
  277. run: cmake -B ${{github.workspace}}/Build/VS2022_Clang -G "Visual Studio 17 2022" -A x64 -T ClangCL Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  278. - name: Build
  279. run: msbuild Build\VS2022_Clang\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  280. - name: Test
  281. working-directory: ${{github.workspace}}/Build/VS2022_Clang/${{matrix.build_type}}
  282. run: ./UnitTests.exe
  283. macos:
  284. runs-on: macos-latest
  285. name: macOS
  286. strategy:
  287. fail-fast: false
  288. matrix:
  289. build_type: [Debug, Release, Distribution]
  290. clang_version: [clang++]
  291. steps:
  292. - name: Checkout Code
  293. uses: actions/checkout@v4
  294. - name: Configure CMake
  295. # github macos-latest runs on a 2013 Ivy Bridge CPU so doesn't have AVX2, LZCNT, TZCNT or FMADD
  296. 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
  297. - name: Build
  298. run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -j 2
  299. - name: Test
  300. working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}}
  301. run: ctest --output-on-failure --verbose
  302. android:
  303. runs-on: ubuntu-latest
  304. name: Android
  305. strategy:
  306. fail-fast: false
  307. steps:
  308. - name: Checkout Code
  309. uses: actions/checkout@v4
  310. - name: Setup Java
  311. uses: actions/setup-java@v4
  312. with:
  313. distribution: 'temurin'
  314. java-version: '17'
  315. - name: Gradle Build
  316. working-directory: ${{github.workspace}}/Build/Android
  317. run: ./gradlew build --no-daemon
  318. ios:
  319. runs-on: macos-latest
  320. name: iOS
  321. strategy:
  322. fail-fast: false
  323. steps:
  324. - name: Checkout Code
  325. uses: actions/checkout@v4
  326. - name: Configure CMake
  327. run: cmake -B ${{github.workspace}}/Build/XCode_iOS -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF -DCMAKE_SYSTEM_NAME=iOS -GXcode Build
  328. - name: Build
  329. run: cmake --build ${{github.workspace}}/Build/XCode_iOS -- -sdk iphonesimulator -arch x86_64