build.yml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. name: build
  2. # build on c/cpp changes or workflow changes
  3. on:
  4. - push
  5. - pull_request
  6. jobs:
  7. linux-gl:
  8. runs-on: ubuntu-20.04
  9. steps:
  10. - uses: actions/checkout@v4
  11. - name: Install deps
  12. run: |
  13. sudo apt-get update
  14. sudo apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
  15. - name: Build
  16. run: |
  17. cmake . -DUSE_SDL2=OFF
  18. make VERBOSE=1 -j2
  19. - name: Test
  20. run: |
  21. ctest --output-on-failure
  22. - name: Package
  23. run: |
  24. make DESTDIR=$PWD/_install install
  25. tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
  26. - uses: actions/upload-artifact@v4
  27. with:
  28. name: irrlicht-linux
  29. path: ./irrlicht-linux.tar.gz
  30. linux-gles:
  31. # Xvfb test is broken on 20.04 for unknown reasons (not our bug)
  32. runs-on: ubuntu-22.04
  33. steps:
  34. - uses: actions/checkout@v4
  35. - name: Install deps
  36. run: |
  37. sudo apt-get update
  38. sudo apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
  39. - name: Build
  40. run: |
  41. cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=OFF -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
  42. make -j2
  43. - name: Test (headless)
  44. run: |
  45. cd bin/Linux
  46. ./AutomatedTest null
  47. - name: Test (Xvfb)
  48. run: |
  49. cd bin/Linux
  50. LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
  51. linux-sdl:
  52. runs-on: ubuntu-20.04
  53. steps:
  54. - uses: actions/checkout@v4
  55. - name: Install deps
  56. run: |
  57. sudo apt-get update
  58. sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
  59. - name: Build
  60. run: |
  61. cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DCMAKE_BUILD_TYPE=Debug
  62. make -j2
  63. - name: Test (headless)
  64. run: |
  65. cd bin/Linux
  66. ./AutomatedTest null
  67. linux-sdl-gl3:
  68. # Xvfb test is broken on 20.04 for unknown reasons (not our bug)
  69. runs-on: ubuntu-22.04
  70. steps:
  71. - uses: actions/checkout@v4
  72. - name: Install deps
  73. run: |
  74. sudo apt-get update
  75. sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
  76. - name: Build
  77. run: |
  78. cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON
  79. make -j2
  80. - name: Test (headless)
  81. run: |
  82. cd bin/Linux
  83. ./AutomatedTest null
  84. - name: Test (Xvfb)
  85. run: |
  86. cd bin/Linux
  87. LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest opengl3
  88. linux-sdl-gles2:
  89. runs-on: ubuntu-20.04
  90. steps:
  91. - uses: actions/checkout@v4
  92. - name: Install deps
  93. run: |
  94. sudo apt-get update
  95. sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
  96. - name: Build
  97. run: |
  98. cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
  99. make -j2
  100. - name: Test (headless)
  101. run: |
  102. cd bin/Linux
  103. ./AutomatedTest null
  104. - name: Test (Xvfb)
  105. run: |
  106. cd bin/Linux
  107. LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
  108. mingw:
  109. name: "MinGW ${{matrix.config.variant}}${{matrix.config.extras}}"
  110. runs-on: ubuntu-22.04
  111. strategy:
  112. fail-fast: false
  113. matrix:
  114. config:
  115. - {variant: win32, arch: i686}
  116. - {variant: win64, arch: x86_64}
  117. - {variant: win32, arch: i686, extras: "-sdl"}
  118. - {variant: win64, arch: x86_64, extras: "-sdl"}
  119. steps:
  120. - uses: actions/checkout@v4
  121. - name: Install compiler
  122. run: |
  123. sudo apt-get update && sudo apt-get install cmake -qyy
  124. ./scripts/ci-get-mingw.sh
  125. - name: Build
  126. run: |
  127. ./scripts/ci-build-mingw.sh package
  128. env:
  129. CC: ${{matrix.config.arch}}-w64-mingw32-clang
  130. CXX: ${{matrix.config.arch}}-w64-mingw32-clang++
  131. extras: ${{matrix.config.extras}}
  132. - uses: actions/upload-artifact@v4
  133. with:
  134. name: irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}
  135. path: ./irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}.zip
  136. macos:
  137. runs-on: macos-latest
  138. steps:
  139. - uses: actions/checkout@v4
  140. - name: Install deps
  141. run: |
  142. brew update --auto-update
  143. brew install cmake libpng jpeg
  144. env:
  145. HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
  146. HOMEBREW_NO_INSTALL_CLEANUP: 1
  147. - name: Build
  148. run: |
  149. cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1
  150. make -j3
  151. - name: Test (headless)
  152. run: |
  153. ./bin/OSX/AutomatedTest null
  154. macos-sdl:
  155. runs-on: macos-latest
  156. steps:
  157. - uses: actions/checkout@v4
  158. - name: Install deps
  159. run: |
  160. brew update --auto-update
  161. brew install cmake libpng jpeg sdl2
  162. env:
  163. HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
  164. HOMEBREW_NO_INSTALL_CLEANUP: 1
  165. - name: Build
  166. run: |
  167. cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1 -DUSE_SDL2=1
  168. make -j3
  169. msvc:
  170. name: VS 2019 ${{ matrix.config.arch }} ${{ matrix.sdl.label }}
  171. runs-on: windows-2019
  172. env:
  173. VCPKG_VERSION: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
  174. # 2023.10.19
  175. vcpkg_packages: zlib libpng libjpeg-turbo
  176. strategy:
  177. fail-fast: false
  178. matrix:
  179. config:
  180. -
  181. arch: x86
  182. generator: "-G'Visual Studio 16 2019' -A Win32"
  183. vcpkg_triplet: x86-windows
  184. -
  185. arch: x64
  186. generator: "-G'Visual Studio 16 2019' -A x64"
  187. vcpkg_triplet: x64-windows
  188. sdl:
  189. -
  190. use: FALSE
  191. label: '(no SDL)'
  192. vcpkg_packages: opengl-registry
  193. -
  194. use: TRUE
  195. label: '(with SDL)'
  196. vcpkg_packages: sdl2
  197. steps:
  198. - name: Checkout
  199. uses: actions/checkout@v4
  200. - name: Restore from cache and run vcpkg
  201. uses: lukka/run-vcpkg@v7
  202. with:
  203. vcpkgArguments: ${{env.vcpkg_packages}} ${{matrix.sdl.vcpkg_packages}}
  204. vcpkgDirectory: '${{ github.workspace }}\vcpkg'
  205. appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
  206. vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
  207. vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
  208. - name: CMake
  209. run: |
  210. cmake ${{matrix.config.generator}} `
  211. -DUSE_SDL2=${{matrix.sdl.use}} `
  212. -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
  213. -DCMAKE_BUILD_TYPE=Release .
  214. - name: Build
  215. run: cmake --build . --config Release
  216. - name: Create artifact folder
  217. run: |
  218. mkdir artifact/
  219. mkdir artifact/lib/
  220. - name: Move dlls into artifact folder
  221. run: move bin\Win32-VisualStudio\Release\* artifact\lib\
  222. - name: Move includes into artifact folder
  223. run: move include artifact/
  224. - name: Upload Artifact
  225. uses: actions/upload-artifact@v4
  226. with:
  227. name: msvc-${{ matrix.config.arch }}-${{matrix.sdl.use}}
  228. path: artifact/
  229. android:
  230. name: Android ${{ matrix.arch }}
  231. runs-on: ubuntu-20.04
  232. env:
  233. ndk_version: "r25c"
  234. ANDROID_NDK: ${{ github.workspace }}/android-ndk
  235. strategy:
  236. matrix:
  237. arch: [armeabi-v7a, arm64-v8a, x86, x86_64]
  238. steps:
  239. - name: Checkout
  240. uses: actions/checkout@v4
  241. - name: Install deps
  242. run: |
  243. sudo rm /var/lib/man-db/auto-update
  244. sudo apt-get update
  245. sudo apt-get install -qyy wget unzip zip gcc-multilib make cmake
  246. - name: Cache NDK
  247. id: cache-ndk
  248. uses: actions/cache@v4
  249. with:
  250. key: android-ndk-${{ env.ndk_version }}-linux
  251. path: ${{ env.ANDROID_NDK }}
  252. - name: Install NDK
  253. run: |
  254. wget --progress=bar:force "http://dl.google.com/android/repository/android-ndk-${ndk_version}-linux.zip"
  255. unzip -q "android-ndk-${ndk_version}-linux.zip"
  256. rm "android-ndk-${ndk_version}-linux.zip"
  257. mv "android-ndk-${ndk_version}" "${ANDROID_NDK}"
  258. if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }}
  259. - name: Build
  260. run: ./scripts/ci-build-android.sh ${{ matrix.arch }}
  261. #- name: Upload Artifact
  262. # uses: actions/upload-artifact@v4
  263. # with:
  264. # name: irrlicht-android-${{ matrix.arch }}
  265. # path: ${{ runner.temp }}/pkg/${{ matrix.arch }}