main.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. name: CI
  2. concurrency:
  3. group: ${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. pull_request:
  8. jobs:
  9. msvc:
  10. strategy:
  11. fail-fast: true
  12. matrix:
  13. include: [
  14. { config: Debug, platform: Win32, bindir: 'win32_vs2019' },
  15. { config: Debug, platform: x64, bindir: 'win64_vs2019' },
  16. { config: Release, platform: Win32, bindir: 'win32_vs2019' },
  17. { config: Release, platform: x64, bindir: 'win64_vs2019' },
  18. ]
  19. name: msvc-${{ matrix.config }}-${{ matrix.platform }}
  20. runs-on: windows-2019
  21. steps:
  22. - name: Checkout bgfx
  23. uses: actions/checkout@v3
  24. with:
  25. path: bgfx
  26. - name: Checkout bx
  27. uses: actions/checkout@v3
  28. with:
  29. repository: bkaradzic/bx
  30. path: bx
  31. - name: Checkout bimg
  32. uses: actions/checkout@v3
  33. with:
  34. repository: bkaradzic/bimg
  35. path: bimg
  36. - name: Prepare
  37. uses: microsoft/[email protected]
  38. - name: Build
  39. shell: cmd
  40. run: |
  41. cd bgfx
  42. ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019
  43. msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
  44. - name: Check
  45. shell: cmd
  46. run: |
  47. cd bgfx
  48. dir /s ".build\${{ matrix.bindir }}\bin"
  49. ".build\${{ matrix.bindir }}\bin\geometryc${{ matrix.config }}.exe" --version
  50. ".build\${{ matrix.bindir }}\bin\shaderc${{ matrix.config }}.exe" --version
  51. ".build\${{ matrix.bindir }}\bin\texturec${{ matrix.config }}.exe" --version
  52. mingw:
  53. strategy:
  54. fail-fast: true
  55. matrix:
  56. include: [
  57. { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' },
  58. { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' },
  59. ]
  60. name: mingw-${{ matrix.msystem }}
  61. runs-on: windows-latest
  62. steps:
  63. - name: Checkout bgfx
  64. uses: actions/checkout@v3
  65. with:
  66. path: bgfx
  67. - name: Checkout bx
  68. uses: actions/checkout@v3
  69. with:
  70. repository: bkaradzic/bx
  71. path: bx
  72. - name: Checkout bimg
  73. uses: actions/checkout@v3
  74. with:
  75. repository: bkaradzic/bimg
  76. path: bimg
  77. - name: Prepare
  78. uses: msys2/setup-msys2@v2
  79. with:
  80. msystem: ${{ matrix.msystem }}
  81. update: true
  82. install: make
  83. pacboy: cc:p
  84. - name: Build
  85. shell: msys2 {0}
  86. run: |
  87. cd bgfx
  88. make ${{ matrix.project }}-release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX
  89. - name: Check
  90. shell: cmd
  91. run: |
  92. cd bgfx
  93. dir /s ".build\${{ matrix.bindir }}\bin"
  94. ".build\${{ matrix.bindir }}\bin\geometrycRelease.exe" --version
  95. ".build\${{ matrix.bindir }}\bin\shadercRelease.exe" --version
  96. ".build\${{ matrix.bindir }}\bin\texturecRelease.exe" --version
  97. linux:
  98. strategy:
  99. fail-fast: true
  100. matrix:
  101. include: [
  102. { config: debug, binsuffix: Debug },
  103. { config: release, binsuffix: Release },
  104. ]
  105. name: linux-${{ matrix.config }}64
  106. runs-on: ubuntu-22.04
  107. steps:
  108. - name: Checkout bgfx
  109. uses: actions/checkout@v3
  110. with:
  111. path: bgfx
  112. - name: Checkout bx
  113. uses: actions/checkout@v3
  114. with:
  115. repository: bkaradzic/bx
  116. path: bx
  117. - name: Checkout bimg
  118. uses: actions/checkout@v3
  119. with:
  120. repository: bkaradzic/bimg
  121. path: bimg
  122. - name: Build
  123. run: |
  124. sudo apt install libgl-dev
  125. cd bgfx
  126. make -j$(nproc) linux-${{ matrix.config }}64
  127. - name: Check
  128. run: |
  129. cd bgfx
  130. ls -lash ".build/linux64_gcc/bin"
  131. ".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version
  132. ".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version
  133. ".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version
  134. wasm:
  135. strategy:
  136. fail-fast: true
  137. matrix:
  138. config: [ debug, release]
  139. name: wasm-${{ matrix.config }}
  140. runs-on: ubuntu-22.04
  141. steps:
  142. - name: Checkout bgfx
  143. uses: actions/checkout@v3
  144. with:
  145. path: bgfx
  146. - name: Checkout bx
  147. uses: actions/checkout@v3
  148. with:
  149. repository: bkaradzic/bx
  150. path: bx
  151. - name: Checkout bimg
  152. uses: actions/checkout@v3
  153. with:
  154. repository: bkaradzic/bimg
  155. path: bimg
  156. - name: Prepare
  157. run: |
  158. docker pull emscripten/emsdk
  159. docker run --rm emscripten/emsdk which emcc em++ emar
  160. cd bgfx
  161. EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake
  162. - name: Build
  163. run: >
  164. docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk
  165. make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten
  166. - name: Check
  167. run: |
  168. cd bgfx
  169. ls -lash ".build/wasm/bin"
  170. osx:
  171. strategy:
  172. fail-fast: true
  173. matrix:
  174. include: [
  175. { config: debug, binsuffix: Debug },
  176. { config: release, binsuffix: Release },
  177. ]
  178. name: osx-x64-${{ matrix.config }}
  179. runs-on: macos-latest
  180. steps:
  181. - name: Checkout bgfx
  182. uses: actions/checkout@v3
  183. with:
  184. path: bgfx
  185. - name: Checkout bx
  186. uses: actions/checkout@v3
  187. with:
  188. repository: bkaradzic/bx
  189. path: bx
  190. - name: Checkout bimg
  191. uses: actions/checkout@v3
  192. with:
  193. repository: bkaradzic/bimg
  194. path: bimg
  195. - name: Build
  196. run: |
  197. cd bgfx
  198. make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }}
  199. - name: Check
  200. run: |
  201. cd bgfx
  202. ls -lash ".build/osx-x64/bin"
  203. ".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version
  204. ".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version
  205. ".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version
  206. android:
  207. strategy:
  208. fail-fast: true
  209. matrix:
  210. include: [
  211. { platform: arm64 },
  212. ]
  213. name: android-${{ matrix.platform }}
  214. runs-on: ubuntu-22.04
  215. steps:
  216. - uses: nttld/setup-ndk@v1
  217. id: setup-ndk
  218. with:
  219. ndk-version: r25b
  220. add-to-path: false
  221. - name: Checkout bgfx
  222. uses: actions/checkout@v3
  223. with:
  224. path: bgfx
  225. - name: Checkout bx
  226. uses: actions/checkout@v3
  227. with:
  228. repository: bkaradzic/bx
  229. path: bx
  230. - name: Checkout bimg
  231. uses: actions/checkout@v3
  232. with:
  233. repository: bkaradzic/bimg
  234. path: bimg
  235. - name: Build
  236. run: |
  237. cd bgfx
  238. make -j$(sysctl -n hw.physicalcpu) android-${{ matrix.platform }}
  239. env:
  240. ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
  241. - name: Check
  242. run: |
  243. cd bgfx
  244. ls -lash ".build/android-${{ matrix.platform }}/bin"