main.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. name: build_and_test
  2. on: [push, pull_request]
  3. jobs:
  4. docs:
  5. runs-on: ubuntu-20.04
  6. steps:
  7. - uses: actions/checkout@v3
  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-20.04
  21. steps:
  22. - uses: actions/checkout@v3
  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;21.4.7075529"
  30. - name: android-arm-make-debug
  31. run: |
  32. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  33. export ANDROID_NDK_ABI=23
  34. make MAKE_JOBS=2 android-arm-debug
  35. - name: android-arm-make-development
  36. run: |
  37. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  38. export ANDROID_NDK_ABI=23
  39. make MAKE_JOBS=2 android-arm-development
  40. - name: android-arm-make-release
  41. run: |
  42. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  43. export ANDROID_NDK_ABI=23
  44. make MAKE_JOBS=2 android-arm-release
  45. - name: android-arm64-make-debug
  46. run: |
  47. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  48. export ANDROID_NDK_ABI=23
  49. make MAKE_JOBS=2 android-arm64-debug
  50. - name: android-arm64-make-development
  51. run: |
  52. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  53. export ANDROID_NDK_ABI=23
  54. make MAKE_JOBS=2 android-arm64-development
  55. - name: android-arm64-make-release
  56. run: |
  57. export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/21.4.7075529
  58. export ANDROID_NDK_ABI=23
  59. make MAKE_JOBS=2 android-arm64-release
  60. html5:
  61. runs-on: ubuntu-20.04
  62. steps:
  63. - uses: actions/checkout@v3
  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=2 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=2 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=2 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-20.04
  93. steps:
  94. - uses: actions/checkout@v3
  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=2 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=2 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=2 linux-release64
  118. - name: linux-test-release64
  119. run: |
  120. cd ./build/linux64/bin && ./crown-release --run-unit-tests
  121. - name: linux-make-level-editor-debug64
  122. run: |
  123. make MAKE_JOBS=2 level-editor-linux-debug64
  124. - name: linux-make-level-editor-release64
  125. run: |
  126. make MAKE_JOBS=2 level-editor-linux-release64
  127. windows:
  128. runs-on: windows-2019
  129. steps:
  130. - uses: actions/checkout@v3
  131. - name: luajit
  132. shell: cmd
  133. run: |
  134. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  135. cd "3rdparty\luajit\src"
  136. .\msvcbuild.bat
  137. - name: luajit-copy-libs
  138. shell: cmd
  139. run: |
  140. md "build\windows64\bin"
  141. cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/lua51.dll 3rdparty/luajit/src/lua51.lib build/windows64/bin
  142. - name: windows-generate-projects
  143. shell: cmd
  144. run: |
  145. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  146. scripts\genie\bin\windows\genie --file=scripts\genie.lua --with-tools --no-level-editor vs2019
  147. - name: windows-make-debug64
  148. shell: cmd
  149. run: |
  150. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  151. devenv build/projects/vs2019/crown.sln /Build "debug|x64" /Project crown
  152. - name: windows-test-debug64
  153. shell: cmd
  154. run: |
  155. build\windows64\bin\crown-debug.exe --run-unit-tests
  156. - name: windows-make-development64
  157. shell: cmd
  158. run: |
  159. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  160. devenv build/projects/vs2019/crown.sln /Build "development|x64" /Project crown
  161. - name: windows-test-development64
  162. shell: cmd
  163. run: |
  164. build\windows64\bin\crown-development.exe --run-unit-tests
  165. - name: windows-make-release64
  166. shell: cmd
  167. run: |
  168. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  169. devenv build/projects/vs2019/crown.sln /Build "release|x64" /Project crown
  170. - name: windows-test-release64
  171. shell: cmd
  172. run: |
  173. build\windows64\bin\crown-release.exe --run-unit-tests
  174. - uses: msys2/setup-msys2@v2
  175. - name: mingw-prepare
  176. shell: msys2 {0}
  177. run: |
  178. 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
  179. - name: mingw-make-level-editor-debug64
  180. shell: msys2 {0}
  181. run: |
  182. export MINGW=/mingw64
  183. make MAKE_JOBS=2 level-editor-mingw-debug64
  184. - name: mingw-make-level-editor-release64
  185. shell: msys2 {0}
  186. run: |
  187. export MINGW=/mingw64
  188. make MAKE_JOBS=2 level-editor-mingw-release64
  189. code-style:
  190. runs-on: ubuntu-20.04
  191. needs: [android-arm, html5, linux, windows]
  192. steps:
  193. - uses: actions/checkout@v3
  194. - name: format
  195. run: |
  196. make MAKE_JOBS=2 format-sources
  197. - name: check-diff
  198. run: |
  199. exit `git diff --shortstat | wc -l`