build.yml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. name: build
  2. # build on c/cpp changes or workflow changes
  3. on:
  4. push:
  5. paths:
  6. - 'lib/**.[ch]'
  7. - 'lib/**.cpp'
  8. - 'src/**.[ch]'
  9. - 'src/**.cpp'
  10. - '**/CMakeLists.txt'
  11. - 'cmake/Modules/**'
  12. - 'util/buildbot/**'
  13. - 'util/ci/**'
  14. - '.github/workflows/**.yml'
  15. - 'Dockerfile'
  16. - '.dockerignore'
  17. pull_request:
  18. paths:
  19. - 'lib/**.[ch]'
  20. - 'lib/**.cpp'
  21. - 'src/**.[ch]'
  22. - 'src/**.cpp'
  23. - '**/CMakeLists.txt'
  24. - 'cmake/Modules/**'
  25. - 'util/buildbot/**'
  26. - 'util/ci/**'
  27. - '.github/workflows/**.yml'
  28. - 'Dockerfile'
  29. - '.dockerignore'
  30. jobs:
  31. # Older gcc version (should be close to our minimum supported version)
  32. gcc_5:
  33. runs-on: ubuntu-18.04
  34. steps:
  35. - uses: actions/checkout@v2
  36. - name: Install deps
  37. run: |
  38. source ./util/ci/common.sh
  39. install_linux_deps g++-5
  40. - name: Build
  41. run: |
  42. ./util/ci/build.sh
  43. env:
  44. CC: gcc-5
  45. CXX: g++-5
  46. - name: Test
  47. run: |
  48. ./bin/minetest --run-unittests
  49. # Current gcc version
  50. gcc_10:
  51. runs-on: ubuntu-20.04
  52. steps:
  53. - uses: actions/checkout@v2
  54. - name: Install deps
  55. run: |
  56. source ./util/ci/common.sh
  57. install_linux_deps g++-10
  58. - name: Build
  59. run: |
  60. ./util/ci/build.sh
  61. env:
  62. CC: gcc-10
  63. CXX: g++-10
  64. - name: Test
  65. run: |
  66. ./bin/minetest --run-unittests
  67. # Older clang version (should be close to our minimum supported version)
  68. clang_3_9:
  69. runs-on: ubuntu-18.04
  70. steps:
  71. - uses: actions/checkout@v2
  72. - name: Install deps
  73. run: |
  74. source ./util/ci/common.sh
  75. install_linux_deps clang-3.9 gdb
  76. - name: Build
  77. run: |
  78. ./util/ci/build.sh
  79. env:
  80. CC: clang-3.9
  81. CXX: clang++-3.9
  82. - name: Unittest
  83. run: |
  84. ./bin/minetest --run-unittests
  85. - name: Integration test + devtest
  86. run: |
  87. ./util/test_multiplayer.sh
  88. # Current clang version
  89. clang_10:
  90. runs-on: ubuntu-20.04
  91. steps:
  92. - uses: actions/checkout@v2
  93. - name: Install deps
  94. run: |
  95. source ./util/ci/common.sh
  96. install_linux_deps clang-10 valgrind libluajit-5.1-dev
  97. - name: Build
  98. run: |
  99. ./util/ci/build.sh
  100. env:
  101. CC: clang-10
  102. CXX: clang++-10
  103. CMAKE_FLAGS: "-DREQUIRE_LUAJIT=1"
  104. - name: Test
  105. run: |
  106. ./bin/minetest --run-unittests
  107. - name: Valgrind
  108. run: |
  109. valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
  110. # Build with prometheus-cpp (server-only)
  111. clang_9_prometheus:
  112. name: "clang_9 (PROMETHEUS=1)"
  113. runs-on: ubuntu-18.04
  114. steps:
  115. - uses: actions/checkout@v2
  116. - name: Install deps
  117. run: |
  118. source ./util/ci/common.sh
  119. install_linux_deps --old-irr clang-9
  120. - name: Build prometheus-cpp
  121. run: |
  122. ./util/ci/build_prometheus_cpp.sh
  123. - name: Build
  124. run: |
  125. ./util/ci/build.sh
  126. env:
  127. CC: clang-9
  128. CXX: clang++-9
  129. CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0"
  130. - name: Test
  131. run: |
  132. ./bin/minetestserver --run-unittests
  133. docker:
  134. name: "Docker image"
  135. runs-on: ubuntu-18.04
  136. steps:
  137. - uses: actions/checkout@v2
  138. - name: Build docker image
  139. run: |
  140. docker build . -t minetest:latest
  141. docker run --rm minetest:latest /usr/local/bin/minetestserver --version
  142. win32:
  143. name: "MinGW cross-compiler (32-bit)"
  144. runs-on: ubuntu-20.04
  145. steps:
  146. - uses: actions/checkout@v2
  147. - name: Install compiler
  148. run: |
  149. sudo apt-get update -q && sudo apt-get install gettext -qyy
  150. wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
  151. sudo tar -xaf mingw.tar.xz -C /usr
  152. - name: Build
  153. run: |
  154. EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild
  155. env:
  156. NO_MINETEST_GAME: 1
  157. NO_PACKAGE: 1
  158. win64:
  159. name: "MinGW cross-compiler (64-bit)"
  160. runs-on: ubuntu-20.04
  161. steps:
  162. - uses: actions/checkout@v2
  163. - name: Install compiler
  164. run: |
  165. sudo apt-get update -q && sudo apt-get install gettext -qyy
  166. wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
  167. sudo tar -xaf mingw.tar.xz -C /usr
  168. - name: Build
  169. run: |
  170. EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild
  171. env:
  172. NO_MINETEST_GAME: 1
  173. NO_PACKAGE: 1
  174. msvc:
  175. name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
  176. runs-on: windows-2019
  177. #### Disabled due to Irrlicht switch
  178. if: false
  179. #### Disabled due to Irrlicht switch
  180. env:
  181. VCPKG_VERSION: 0bf3923f9fab4001c00f0f429682a0853b5749e0
  182. # 2020.11
  183. vcpkg_packages: irrlicht zlib zstd curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit
  184. strategy:
  185. fail-fast: false
  186. matrix:
  187. config:
  188. - {
  189. arch: x86,
  190. generator: "-G'Visual Studio 16 2019' -A Win32",
  191. vcpkg_triplet: x86-windows
  192. }
  193. - {
  194. arch: x64,
  195. generator: "-G'Visual Studio 16 2019' -A x64",
  196. vcpkg_triplet: x64-windows
  197. }
  198. type: [portable]
  199. # type: [portable, installer]
  200. # The installer type is working, but disabled, to save runner jobs.
  201. # Enable it, when working on the installer.
  202. steps:
  203. - name: Checkout
  204. uses: actions/checkout@v2
  205. - name: Restore from cache and run vcpkg
  206. uses: lukka/run-vcpkg@v5
  207. with:
  208. vcpkgArguments: ${{env.vcpkg_packages}}
  209. vcpkgDirectory: '${{ github.workspace }}\vcpkg'
  210. appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
  211. vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
  212. vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
  213. - name: CMake
  214. run: |
  215. cmake ${{matrix.config.generator}} `
  216. -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
  217. -DCMAKE_BUILD_TYPE=Release `
  218. -DENABLE_POSTGRESQL=OFF `
  219. -DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
  220. - name: Build
  221. run: cmake --build . --config Release
  222. - name: CPack
  223. run: |
  224. If ($env:TYPE -eq "installer")
  225. {
  226. cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
  227. }
  228. ElseIf($env:TYPE -eq "portable")
  229. {
  230. cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
  231. }
  232. env:
  233. TYPE: ${{matrix.type}}
  234. - name: Package Clean
  235. run: rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
  236. - uses: actions/upload-artifact@v1
  237. with:
  238. name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
  239. path: .\Package\