main.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. name: build_and_test
  2. on: [push, pull_request]
  3. jobs:
  4. docs:
  5. runs-on: ubuntu-22.04
  6. steps:
  7. - uses: actions/checkout@v4
  8. - name: prepare
  9. run: |
  10. sudo apt-get update
  11. sudo apt-get install codespell
  12. sudo apt-get install python3-sphinx
  13. - name: spellcheck
  14. run: |
  15. make codespell
  16. - name: docs
  17. run: |
  18. make docs
  19. android-arm:
  20. runs-on: ubuntu-22.04
  21. steps:
  22. - uses: actions/checkout@v4
  23. - name: prepare
  24. run: |
  25. sudo apt-get update
  26. sudo apt-get install libc6-dev-i386
  27. ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
  28. SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
  29. echo "y" | $SDKMANAGER "ndk;23.2.8568313"
  30. - name: android-arm-make-debug
  31. run: |
  32. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  33. export ANDROID_NDK_ABI=23
  34. make MAKE_JOBS=4 android-arm-debug
  35. - name: android-arm-make-development
  36. run: |
  37. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  38. export ANDROID_NDK_ABI=23
  39. make MAKE_JOBS=4 android-arm-development
  40. - name: android-arm-make-release
  41. run: |
  42. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  43. export ANDROID_NDK_ABI=23
  44. make MAKE_JOBS=4 android-arm-release
  45. - name: android-arm64-make-debug
  46. run: |
  47. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  48. export ANDROID_NDK_ABI=23
  49. make MAKE_JOBS=4 android-arm64-debug
  50. - name: android-arm64-make-development
  51. run: |
  52. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  53. export ANDROID_NDK_ABI=23
  54. make MAKE_JOBS=4 android-arm64-development
  55. - name: android-arm64-make-release
  56. run: |
  57. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313
  58. export ANDROID_NDK_ABI=23
  59. make MAKE_JOBS=4 android-arm64-release
  60. html5:
  61. runs-on: ubuntu-22.04
  62. steps:
  63. - uses: actions/checkout@v4
  64. - name: prepare
  65. run: |
  66. git clone https://github.com/emscripten-core/emsdk.git
  67. cd emsdk
  68. ./emsdk install latest
  69. ./emsdk activate latest
  70. - name: wasm-make-debug
  71. run: |
  72. export EMSCRIPTEN=$GITHUB_WORKSPACE/emsdk/upstream/emscripten
  73. make MAKE_JOBS=4 wasm-debug
  74. - name: wasm-test-debug
  75. run: |
  76. cd ./build/wasm/bin && node crown-debug --run-unit-tests
  77. - name: wasm-make-development
  78. run: |
  79. export EMSCRIPTEN=$GITHUB_WORKSPACE/emsdk/upstream/emscripten
  80. make MAKE_JOBS=4 wasm-development
  81. - name: wasm-test-development
  82. run: |
  83. cd ./build/wasm/bin && node crown-development --run-unit-tests
  84. - name: wasm-make-release
  85. run: |
  86. export EMSCRIPTEN=$GITHUB_WORKSPACE/emsdk/upstream/emscripten
  87. make MAKE_JOBS=4 wasm-release
  88. - name: wasm-test-release
  89. run: |
  90. cd ./build/wasm/bin && node crown-release --run-unit-tests
  91. linux:
  92. runs-on: ubuntu-22.04
  93. steps:
  94. - uses: actions/checkout@v4
  95. - name: prepare
  96. run: |
  97. sudo apt-get update
  98. sudo apt-get install mesa-common-dev libgl1-mesa-dev libpulse-dev libxrandr-dev libc6-dev-i386
  99. sudo apt-get install libgtk-3-dev
  100. sudo add-apt-repository ppa:vala-team
  101. sudo apt-get install valac libgee-0.8-dev
  102. sudo apt-get install libxml2-utils # xml-stripblanks
  103. - name: linux-make-debug64
  104. run: |
  105. make MAKE_JOBS=4 linux-debug64
  106. - name: linux-test-debug64
  107. run: |
  108. cd ./build/linux64/bin && ./crown-debug --run-unit-tests
  109. - name: linux-make-development64
  110. run: |
  111. make MAKE_JOBS=4 linux-development64
  112. - name: linux-test-development64
  113. run: |
  114. cd ./build/linux64/bin && ./crown-development --run-unit-tests
  115. - name: linux-make-release64
  116. run: |
  117. make MAKE_JOBS=4 linux-release64
  118. - name: linux-test-release64
  119. run: |
  120. cd ./build/linux64/bin && ./crown-release --run-unit-tests
  121. - name: linux-make-crown-editor-debug64
  122. run: |
  123. make MAKE_JOBS=4 crown-editor-linux-debug64
  124. - name: linux-make-crown-editor-release64
  125. run: |
  126. make MAKE_JOBS=4 crown-editor-linux-release64
  127. - name: linux-make-crown-launcher-debug64
  128. run: |
  129. make MAKE_JOBS=4 crown-launcher-linux-debug64
  130. - name: linux-make-crown-launcher-release64
  131. run: |
  132. make MAKE_JOBS=4 crown-launcher-linux-release64
  133. windows:
  134. runs-on: windows-2022
  135. steps:
  136. - uses: actions/checkout@v4
  137. - name: luajit
  138. shell: cmd
  139. run: |
  140. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  141. cd "3rdparty\luajit\src"
  142. .\msvcbuild.bat
  143. - name: luajit-copy-libs
  144. shell: cmd
  145. run: |
  146. md "build\windows64\bin"
  147. cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/lua51.dll 3rdparty/luajit/src/lua51.lib build/windows64/bin
  148. - name: windows-generate-projects
  149. shell: cmd
  150. run: |
  151. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  152. scripts\genie\bin\windows\genie --file=scripts\genie.lua --with-tools --no-editor vs2022
  153. - name: windows-make-debug64
  154. shell: cmd
  155. run: |
  156. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  157. devenv build/projects/vs2022/crown.sln /Build "debug|x64" /Project crown
  158. - name: windows-test-debug64
  159. shell: cmd
  160. run: |
  161. build\windows64\bin\crown-debug.exe --run-unit-tests
  162. - name: windows-make-development64
  163. shell: cmd
  164. run: |
  165. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  166. devenv build/projects/vs2022/crown.sln /Build "development|x64" /Project crown
  167. - name: windows-test-development64
  168. shell: cmd
  169. run: |
  170. build\windows64\bin\crown-development.exe --run-unit-tests
  171. - name: windows-make-release64
  172. shell: cmd
  173. run: |
  174. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  175. devenv build/projects/vs2022/crown.sln /Build "release|x64" /Project crown
  176. - name: windows-test-release64
  177. shell: cmd
  178. run: |
  179. build\windows64\bin\crown-release.exe --run-unit-tests
  180. - uses: msys2/setup-msys2@v2
  181. - name: mingw-prepare
  182. shell: msys2 {0}
  183. run: |
  184. pacman --noconfirm -S make mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gtk3 mingw-w64-x86_64-vala mingw-w64-x86_64-libgee
  185. - name: mingw-make-crown-editor-debug64
  186. shell: msys2 {0}
  187. run: |
  188. export MINGW=/mingw64
  189. make MAKE_JOBS=4 crown-editor-mingw-debug64
  190. - name: mingw-make-crown-editor-release64
  191. shell: msys2 {0}
  192. run: |
  193. export MINGW=/mingw64
  194. make MAKE_JOBS=4 crown-editor-mingw-release64
  195. - name: mingw-make-crown-launcher-debug64
  196. shell: msys2 {0}
  197. run: |
  198. export MINGW=/mingw64
  199. make MAKE_JOBS=4 crown-launcher-mingw-debug64
  200. - name: mingw-make-crown-launcher-release64
  201. shell: msys2 {0}
  202. run: |
  203. export MINGW=/mingw64
  204. make MAKE_JOBS=4 crown-launcher-mingw-release64
  205. code-style:
  206. runs-on: ubuntu-22.04
  207. needs: [android-arm, html5, linux, windows]
  208. steps:
  209. - uses: actions/checkout@v4
  210. - name: format
  211. run: |
  212. make MAKE_JOBS=4 format-sources
  213. - name: check-diff
  214. run: |
  215. exit `git diff --shortstat | wc -l`