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