build.yml 13 KB

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