build.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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. env:
  14. EMSCRIPTEN_VERSION: 3.1.64
  15. UBUNTU_CLANG_VERSION: clang++-18
  16. UBUNTU_GCC_VERSION: g++-14
  17. jobs:
  18. linux-clang:
  19. runs-on: ubuntu-latest
  20. name: Linux Clang
  21. strategy:
  22. fail-fast: false
  23. matrix:
  24. build_type: [Debug, Release, Distribution]
  25. double_precision: [No, Yes]
  26. steps:
  27. - name: Checkout Code
  28. uses: actions/checkout@v6
  29. - name: Install Vulkan
  30. run: ${{github.workspace}}/Build/ubuntu24_install_vulkan_sdk.sh
  31. - name: Configure CMake
  32. working-directory: ${{github.workspace}}/Build
  33. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DDOUBLE_PRECISION=${{matrix.double_precision}}
  34. - name: Build
  35. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  36. - name: Test
  37. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  38. run: ctest --output-on-failure --verbose
  39. linux_clang_tsan:
  40. runs-on: ubuntu-24.04
  41. name: Linux Clang Sanitizers
  42. strategy:
  43. fail-fast: false
  44. matrix:
  45. build_type: [ReleaseASAN, ReleaseUBSAN, ReleaseTSAN]
  46. steps:
  47. - name: Checkout Code
  48. uses: actions/checkout@v6
  49. - name: Configure CMake
  50. working-directory: ${{github.workspace}}/Build
  51. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
  52. - name: Build
  53. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  54. - name: Unit Tests
  55. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  56. run: ctest --output-on-failure --verbose
  57. - name: Test ConvexVsMesh
  58. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  59. run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh
  60. - name: Test Ragdoll
  61. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  62. run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll
  63. linux-clang-so:
  64. runs-on: ubuntu-24.04
  65. name: Linux Clang Shared Library
  66. strategy:
  67. fail-fast: false
  68. matrix:
  69. build_type: [Debug, Release, Distribution]
  70. steps:
  71. - name: Checkout Code
  72. uses: actions/checkout@v6
  73. - name: Configure CMake
  74. working-directory: ${{github.workspace}}/Build
  75. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DBUILD_SHARED_LIBS=YES
  76. - name: Build
  77. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  78. - name: Test
  79. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  80. run: ctest --output-on-failure --verbose
  81. linux-clang-32-bit:
  82. runs-on: ubuntu-24.04
  83. name: Linux Clang 32-bit
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. build_type: [Debug, Release, Distribution]
  88. steps:
  89. - name: Checkout Code
  90. uses: actions/checkout@v6
  91. - name: Update APT
  92. run: sudo apt update
  93. - name: Install G++-Multilib
  94. run: sudo apt -y install g++-multilib
  95. - name: Configure CMake
  96. working-directory: ${{github.workspace}}/Build
  97. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_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
  98. - name: Build
  99. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  100. - name: Test
  101. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  102. run: ctest --output-on-failure --verbose
  103. linux-clang-use-std-vector:
  104. runs-on: ubuntu-24.04
  105. name: Linux Clang using std::vector
  106. strategy:
  107. fail-fast: false
  108. matrix:
  109. build_type: [Debug, ReleaseASAN]
  110. double_precision: [Yes]
  111. steps:
  112. - name: Checkout Code
  113. uses: actions/checkout@v6
  114. - name: Configure CMake
  115. working-directory: ${{github.workspace}}/Build
  116. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DDOUBLE_PRECISION=${{matrix.double_precision}} -DUSE_STD_VECTOR=ON
  117. - name: Build
  118. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  119. - name: Test
  120. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  121. run: ctest --output-on-failure --verbose
  122. linux-gcc:
  123. runs-on: ubuntu-24.04
  124. name: Linux GCC
  125. strategy:
  126. fail-fast: false
  127. matrix:
  128. build_type: [Debug, Release, Distribution]
  129. steps:
  130. - name: Checkout Code
  131. uses: actions/checkout@v6
  132. - name: Install Vulkan
  133. run: ${{github.workspace}}/Build/ubuntu24_install_vulkan_sdk.sh
  134. - name: Configure CMake
  135. working-directory: ${{github.workspace}}/Build
  136. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_GCC_VERSION}}
  137. - name: Build
  138. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  139. - name: Test
  140. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  141. run: ctest --output-on-failure --verbose
  142. linux-gcc-so:
  143. runs-on: ubuntu-24.04
  144. name: Linux GCC Shared Library
  145. strategy:
  146. fail-fast: false
  147. matrix:
  148. build_type: [Debug, Release, Distribution]
  149. steps:
  150. - name: Checkout Code
  151. uses: actions/checkout@v6
  152. - name: Configure CMake
  153. working-directory: ${{github.workspace}}/Build
  154. run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_GCC_VERSION}} -DBUILD_SHARED_LIBS=Yes
  155. - name: Build
  156. run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
  157. - name: Test
  158. working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
  159. run: ctest --output-on-failure --verbose
  160. msys2_mingw_gcc:
  161. runs-on: windows-latest
  162. defaults:
  163. run:
  164. shell: msys2 {0}
  165. name: MSYS2 MinGW GCC
  166. strategy:
  167. fail-fast: false
  168. matrix:
  169. build_type: [Debug, Release]
  170. shared_lib: [No, Yes]
  171. steps:
  172. - name: Checkout Code
  173. uses: actions/checkout@v6
  174. - name: Setup MSYS2
  175. uses: msys2/setup-msys2@v2
  176. with:
  177. msystem: mingw64
  178. install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
  179. update: true
  180. - name: Configure CMake
  181. working-directory: ${{github.workspace}}/Build
  182. run: ./cmake_linux_mingw.sh ${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.shared_lib}}
  183. - name: Build
  184. run: cmake --build Build/MinGW_${{matrix.build_type}} -j $(nproc)
  185. - name: Test
  186. working-directory: Build/MinGW_${{matrix.build_type}}
  187. run: ctest --output-on-failure --verbose
  188. msvc_cl:
  189. runs-on: windows-latest
  190. name: Visual Studio CL
  191. strategy:
  192. fail-fast: false
  193. matrix:
  194. build_type: [Debug, Release, Distribution]
  195. double_precision: [No, Yes]
  196. steps:
  197. - name: Checkout Code
  198. uses: actions/checkout@v6
  199. - name: Add msbuild to PATH
  200. uses: microsoft/setup-msbuild@v2
  201. - name: Configure CMake
  202. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  203. - name: Build
  204. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  205. - name: Test
  206. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  207. run: ./UnitTests.exe
  208. msvc_cl_no_object_stream:
  209. runs-on: windows-latest
  210. name: Visual Studio CL - No Object Stream
  211. strategy:
  212. fail-fast: false
  213. matrix:
  214. build_type: [Debug, Distribution]
  215. steps:
  216. - name: Checkout Code
  217. uses: actions/checkout@v6
  218. - name: Add msbuild to PATH
  219. uses: microsoft/setup-msbuild@v2
  220. - name: Configure CMake
  221. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DENABLE_OBJECT_STREAM=NO
  222. - name: Build
  223. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  224. - name: Test
  225. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  226. run: ./UnitTests.exe
  227. msvc_cl_dll:
  228. runs-on: windows-latest
  229. name: Visual Studio CL Shared Library
  230. strategy:
  231. fail-fast: false
  232. matrix:
  233. build_type: [Debug, Release, Distribution]
  234. steps:
  235. - name: Checkout Code
  236. uses: actions/checkout@v6
  237. - name: Add msbuild to PATH
  238. uses: microsoft/setup-msbuild@v2
  239. - name: Configure CMake
  240. run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DBUILD_SHARED_LIBS=Yes
  241. - name: Build
  242. run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  243. - name: Test
  244. working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
  245. run: ./UnitTests.exe
  246. msvc_cl_32_bit:
  247. runs-on: windows-latest
  248. name: Visual Studio CL 32-bit
  249. strategy:
  250. fail-fast: false
  251. matrix:
  252. build_type: [Debug, Release]
  253. steps:
  254. - name: Checkout Code
  255. uses: actions/checkout@v6
  256. - name: Add msbuild to PATH
  257. uses: microsoft/setup-msbuild@v2
  258. - name: Configure CMake
  259. 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
  260. - name: Build
  261. run: msbuild Build\VS2022_CL_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  262. - name: Test
  263. working-directory: ${{github.workspace}}/Build/VS2022_CL_32_BIT/${{matrix.build_type}}
  264. run: ./UnitTests.exe
  265. msvc_cl_arm:
  266. runs-on: windows-latest
  267. name: Visual Studio CL ARM
  268. strategy:
  269. fail-fast: false
  270. matrix:
  271. build_type: [Debug, Release]
  272. steps:
  273. - name: Checkout Code
  274. uses: actions/checkout@v6
  275. - name: Add msbuild to PATH
  276. uses: microsoft/setup-msbuild@v2
  277. - name: Configure CMake
  278. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 Build
  279. - name: Build
  280. run: msbuild Build\VS2022_CL_ARM\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  281. msvc_cl_arm_32_bit:
  282. runs-on: windows-latest
  283. name: Visual Studio CL ARM 32-bit
  284. strategy:
  285. fail-fast: false
  286. matrix:
  287. build_type: [Debug, Release]
  288. steps:
  289. - name: Checkout Code
  290. uses: actions/checkout@v6
  291. - name: Add msbuild to PATH
  292. uses: microsoft/setup-msbuild@v2
  293. - name: Install Windows 11 SDK (10.0.22621.0)
  294. # Alternative: Start-Process -wait -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "modify", "--installPath", """C:\Program Files\Microsoft Visual Studio\2022\Enterprise""", "--quiet", "--norestart", "--nocache", "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621" -Verb RunAs
  295. run: choco install windows-sdk-11-version-22H2-all -y
  296. - name: Configure CMake
  297. # Windows 11 SDK 10.0.22621.0 is the last SDK to support 32-bit ARM
  298. run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM_32_BIT -G "Visual Studio 17 2022" -A ARM -DCMAKE_SYSTEM_VERSION="10.0.22621.0" -DCMAKE_CXX_COMPILER_WORKS=1 Build
  299. - name: Build
  300. run: msbuild Build\VS2022_CL_ARM_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  301. msvc_clang:
  302. runs-on: windows-latest
  303. name: Visual Studio Clang
  304. strategy:
  305. fail-fast: false
  306. matrix:
  307. build_type: [Debug, Release, Distribution]
  308. double_precision: [No, Yes]
  309. steps:
  310. - name: Checkout Code
  311. uses: actions/checkout@v6
  312. - name: Add msbuild to PATH
  313. uses: microsoft/setup-msbuild@v2
  314. - name: Configure CMake
  315. run: cmake -B ${{github.workspace}}/Build/VS2022_Clang -G "Visual Studio 17 2022" -A x64 -T ClangCL Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
  316. - name: Build
  317. run: msbuild Build\VS2022_Clang\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
  318. - name: Test
  319. working-directory: ${{github.workspace}}/Build/VS2022_Clang/${{matrix.build_type}}
  320. run: ./UnitTests.exe
  321. macos:
  322. runs-on: macos-latest
  323. name: macOS
  324. env:
  325. VULKAN_SDK_INSTALL: ${{github.workspace}}/vulkan_sdk
  326. strategy:
  327. fail-fast: false
  328. matrix:
  329. build_type: [Debug, Release, Distribution]
  330. steps:
  331. - name: Checkout Code
  332. uses: actions/checkout@v6
  333. - name: Install Vulkan
  334. run: ${{github.workspace}}/Build/macos_install_vulkan_sdk.sh ${VULKAN_SDK_INSTALL}
  335. - name: Configure CMake
  336. run: |
  337. source ${VULKAN_SDK_INSTALL}/setup-env.sh
  338. cmake -B ${{github.workspace}}/Build/MacOS_${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=clang++ Build
  339. - name: Build
  340. run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}} -j $(nproc)
  341. - name: Test
  342. working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}
  343. run: ctest --output-on-failure --verbose
  344. android:
  345. runs-on: ubuntu-latest
  346. name: Android
  347. strategy:
  348. fail-fast: false
  349. steps:
  350. - name: Checkout Code
  351. uses: actions/checkout@v6
  352. - name: Setup Java
  353. uses: actions/setup-java@v5
  354. with:
  355. distribution: 'temurin'
  356. java-version: '17'
  357. - name: Gradle Build
  358. working-directory: ${{github.workspace}}/Build/Android
  359. run: ./gradlew build --no-daemon
  360. ios:
  361. runs-on: macos-latest
  362. name: iOS
  363. strategy:
  364. fail-fast: false
  365. steps:
  366. - name: Checkout Code
  367. uses: actions/checkout@v6
  368. - name: Configure CMake
  369. run: cmake -B ${{github.workspace}}/Build/XCode_iOS -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF -DCMAKE_SYSTEM_NAME=iOS -GXcode Build
  370. - name: Build
  371. run: cmake --build ${{github.workspace}}/Build/XCode_iOS -- -sdk iphonesimulator -arch x86_64
  372. emscripten:
  373. runs-on: ubuntu-latest
  374. name: Emscripten
  375. steps:
  376. - name: Checkout Code
  377. uses: actions/checkout@v6
  378. - name: Setup emsdk
  379. uses: mymindstorm/setup-emsdk@v14
  380. with:
  381. version: ${{env.EMSCRIPTEN_VERSION}}
  382. - name: Verify emsdk
  383. run: emcc -v
  384. - name: Setup Node.js 18.x
  385. uses: actions/setup-node@v6
  386. with:
  387. node-version: 18.x
  388. - name: Configure CMake
  389. working-directory: ${{github.workspace}}/Build
  390. run: ./cmake_linux_emscripten.sh Distribution -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF
  391. - name: Build
  392. run: cmake --build ${{github.workspace}}/Build/WASM_Distribution -j $(nproc)
  393. - name: Test
  394. working-directory: ${{github.workspace}}/Build/WASM_Distribution
  395. run: node UnitTests.js