]> git.lizzy.rs Git - dragonfireclient.git/blob - .github/workflows/lua.yml
3af4a6ee78065fe4123e8572659a229be87d46a5
[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     - name: Install luarocks
46       run: |
47         sudo apt-get update && sudo apt-get install -y luarocks
48
49     - name: Install luarocks tools
50       run: |
51         luarocks install --local luacheck
52         luarocks install --local busted
53
54     - name: Run checks (builtin)
55       run: |
56         $HOME/.luarocks/bin/luacheck builtin
57         $HOME/.luarocks/bin/busted builtin
58
59     - name: Run checks (devtest)
60       run: |
61         $HOME/.luarocks/bin/luacheck --config=games/devtest/.luacheckrc games/devtest