lua.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: lua_lint
  2. # Lint on lua changes on builtin or if workflow changed
  3. on:
  4. push:
  5. paths:
  6. - 'builtin/**.lua'
  7. - 'games/devtest/**.lua'
  8. - '.github/workflows/**.yml'
  9. pull_request:
  10. paths:
  11. - 'builtin/**.lua'
  12. - 'games/devtest/**.lua'
  13. - '.github/workflows/**.yml'
  14. jobs:
  15. # Note that the integration tests are also run build.yml, but only when C++ code is changed.
  16. integration_tests:
  17. name: "Compile and run multiplayer tests"
  18. runs-on: ubuntu-20.04
  19. steps:
  20. - uses: actions/checkout@v3
  21. - name: Install deps
  22. run: |
  23. source ./util/ci/common.sh
  24. install_linux_deps clang-10 gdb libluajit-5.1-dev
  25. - name: Build
  26. run: |
  27. ./util/ci/build.sh
  28. env:
  29. CC: clang-10
  30. CXX: clang++-10
  31. CMAKE_FLAGS: "-DENABLE_GETTEXT=0 -DBUILD_SERVER=0"
  32. - name: Integration test + devtest
  33. run: |
  34. ./util/test_multiplayer.sh
  35. luacheck:
  36. name: "Builtin Luacheck and Unit Tests"
  37. runs-on: ubuntu-20.04
  38. steps:
  39. - uses: actions/checkout@v3
  40. - uses: leafo/gh-actions-lua@v9
  41. with:
  42. luaVersion: "5.1.5"
  43. - uses: leafo/gh-actions-luarocks@v4
  44. - name: Install LuaJIT
  45. run: |
  46. cd $HOME
  47. git clone https://github.com/LuaJIT/LuaJIT/
  48. cd LuaJIT
  49. make -j$(nproc)
  50. - name: Install luarocks tools
  51. run: |
  52. luarocks install --local luacheck
  53. luarocks install --local busted
  54. - name: Run checks (builtin)
  55. run: |
  56. $HOME/.luarocks/bin/luacheck builtin
  57. $HOME/.luarocks/bin/busted builtin
  58. $HOME/.luarocks/bin/busted builtin --lua=$HOME/LuaJIT/src/luajit
  59. - name: Run checks (devtest)
  60. run: |
  61. $HOME/.luarocks/bin/luacheck --config=games/devtest/.luacheckrc games/devtest