build.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. name: CI
  2. on:
  3. push:
  4. branches: [ release ]
  5. pull_request:
  6. branches: [ dev, release ]
  7. jobs:
  8. build:
  9. strategy:
  10. fail-fast: false
  11. matrix:
  12. lua_ver: [51, 53]
  13. numbers: ['float']
  14. include:
  15. - lua_ver: 51
  16. numbers: 'integral'
  17. - lua_ver: 53
  18. numbers: '64bit'
  19. runs-on: ubuntu-20.04
  20. env:
  21. LUA: ${{ matrix.lua_ver }}
  22. steps:
  23. - uses: actions/checkout@v2
  24. with:
  25. submodules: true
  26. - run: pip install pyserial
  27. shell: bash
  28. - run: sudo apt install srecord
  29. shell: bash
  30. - name: Build firmware
  31. if: matrix.numbers == 'float'
  32. run: make
  33. shell: bash
  34. - name: Build integral firmware
  35. if: ${{ matrix.numbers == 'integral' }}
  36. run: |
  37. make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL"
  38. mv luac.cross.int luac.cross
  39. shell: bash
  40. - name: Build 64bit firmware
  41. if: ${{ matrix.numbers == '64bit' }}
  42. run: |
  43. make EXTRA_CCFLAGS="-DLUA_NUMBER_64BITS"
  44. shell: bash
  45. - name: Upload luac.cross
  46. if: ${{ success() }}
  47. uses: actions/upload-artifact@v2
  48. with:
  49. name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}
  50. path: luac.cross
  51. build_luac_cross_win:
  52. runs-on: windows-latest
  53. steps:
  54. - uses: actions/checkout@v2
  55. with:
  56. submodules: true
  57. - name: Build luac.cross.exe
  58. run: |
  59. set
  60. "%programfiles%\git\usr\bin\xargs"
  61. cd msvc
  62. "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" /p:Configuration=Release /p:Platform=x64
  63. mv luac-cross/x64/Release/luac.cross.exe ..
  64. shell: cmd
  65. - name: Upload luac.cross
  66. if: ${{ success() }}
  67. uses: actions/upload-artifact@v2
  68. with:
  69. name: luac.cross_51_float_win
  70. path: luac.cross.exe
  71. compile_lua:
  72. strategy:
  73. fail-fast: false
  74. matrix:
  75. lua_ver: [51, 53]
  76. numbers: ['float']
  77. filter: [ 'cat' ]
  78. include:
  79. - lua_ver: 51
  80. numbers: 'integral'
  81. filter: 'grep -v "lua_modules/lm92/lm92.lua\|lua_modules/hdc1000/HDC1000.lua\|lua_examples/u8g2/graphics_test.lua"'
  82. - lua_ver: 53
  83. numbers: '64bit'
  84. filter: 'cat'
  85. needs: build
  86. runs-on: ubuntu-20.04
  87. steps:
  88. - name: Checkout repo
  89. uses: actions/checkout@v2
  90. with:
  91. submodules: false
  92. - name: Download luac.cross
  93. uses: actions/download-artifact@v1
  94. with:
  95. name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}
  96. path: ./
  97. - name: Fix file permission
  98. run: chmod +x luac.cross
  99. - name: compile Lua
  100. run: |
  101. find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" echo
  102. find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" ./luac.cross -p
  103. shell: bash
  104. compile_lua_win:
  105. strategy:
  106. fail-fast: false
  107. matrix:
  108. lua_ver: [51]
  109. numbers: ['float']
  110. filter: [ 'cat' ]
  111. needs: build_luac_cross_win
  112. runs-on: windows-latest
  113. steps:
  114. - name: Checkout repo
  115. uses: actions/checkout@v2
  116. with:
  117. submodules: false
  118. - name: Download luac.cross
  119. uses: actions/download-artifact@v1
  120. with:
  121. name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}_win
  122. path: ./
  123. - name: compile Lua
  124. run: |
  125. PATH="/C/Program\ Files/Git/usr/bin:${PATH}"
  126. find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" echo
  127. find lua_modules lua_examples tests/NTest* -iname "*.lua" | ${{ matrix.filter }} | xargs --delimiter="\n" ./luac.cross -p
  128. shell: bash
  129. NTest:
  130. strategy:
  131. fail-fast: false
  132. matrix:
  133. lua_ver: [51, 53]
  134. numbers: ['float']
  135. include:
  136. - lua_ver: 51
  137. numbers: 'integral'
  138. - lua_ver: 53
  139. numbers: '64bit'
  140. needs: build
  141. runs-on: ubuntu-20.04
  142. steps:
  143. - name: Checkout repo
  144. uses: actions/checkout@v2
  145. with:
  146. submodules: false
  147. - name: Download luac.cross
  148. uses: actions/download-artifact@v1
  149. with:
  150. name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}
  151. path: ./
  152. - name: Fix file permission
  153. run: chmod +x luac.cross
  154. - name: NTest selfcheck
  155. run: |
  156. cd tests/NTest
  157. ../../luac.cross -e ../NTest/NTest_NTest.lua | tee log
  158. grep "failed. 0" log
  159. shell: bash
  160. - name: NTest hosttests
  161. run: |
  162. cd tests
  163. cp NTest/NTest.lua .
  164. ../luac.cross -e NTest_lua.lua | tee log
  165. (if grep " ==> " log ; then exit 1 ; fi)
  166. shell: bash
  167. NTest_win:
  168. strategy:
  169. fail-fast: false
  170. matrix:
  171. lua_ver: [51]
  172. numbers: ['float']
  173. needs: build_luac_cross_win
  174. runs-on: windows-latest
  175. steps:
  176. - name: Checkout repo
  177. uses: actions/checkout@v2
  178. with:
  179. submodules: false
  180. - name: Download luac.cross
  181. uses: actions/download-artifact@v1
  182. with:
  183. name: luac.cross_${{ matrix.lua_ver }}_${{ matrix.numbers }}_win
  184. path: ./
  185. - name: NTest selfcheck
  186. run: |
  187. cd tests/NTest
  188. ../../luac.cross.exe -e ../NTest/NTest_NTest.lua | tee log
  189. grep "failed. 0" log
  190. shell: bash
  191. - name: NTest hosttests
  192. run: |
  193. cd tests
  194. cp NTest/NTest.lua .
  195. ../luac.cross.exe -e NTest_lua.lua | tee log
  196. (if grep " ==> " log ; then exit 1 ; fi)
  197. shell: bash
  198. luacheck:
  199. strategy:
  200. fail-fast: false
  201. matrix:
  202. include:
  203. - os: 'linux'
  204. vm: 'ubuntu-20.04'
  205. - os: 'windows'
  206. vm: 'windows-latest'
  207. runs-on: ${{ matrix.vm }}
  208. steps:
  209. - uses: actions/checkout@v2
  210. with:
  211. submodules: false
  212. - run: sudo apt install luarocks
  213. if : matrix.os == 'linux'
  214. shell: bash
  215. - name: get luacheck.exe # is also done in the travis script but in this action it does not run in bash
  216. if : matrix.os == 'windows'
  217. run: |
  218. mkdir cache
  219. C:msys64\usr\bin\wget.exe --tries=5 --timeout=10 --waitretry=10 --read-timeout=10 --retry-connrefused -O cache/luacheck.exe https://github.com/mpeterv/luacheck/releases/download/0.23.0/luacheck.exe
  220. shell: cmd
  221. - name: luacheck
  222. run: |
  223. PATH="/C/Program\ Files/Git/usr/bin:${PATH}"
  224. ./tools/travis/run-luacheck-${{ matrix.os }}.sh
  225. shell: bash
  226. doc_check:
  227. strategy:
  228. fail-fast: false
  229. runs-on: ubuntu-20.04
  230. steps:
  231. - uses: actions/checkout@v2
  232. with:
  233. submodules: false
  234. - name: all_modules_linked
  235. run: ./tools/check_docs_module_linkage.sh
  236. shell: bash