add luacheck and basic integration test (#9)

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
This commit is contained in:
Buckaroo Banzai 2024-04-21 09:56:57 +02:00 committed by GitHub
parent b002fb8127
commit 8a29455e1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 55 additions and 2 deletions

10
.github/workflows/luacheck.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Luacheck
uses: lunarmodules/luacheck@master

13
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: buckaroobanzay/mtt@main
with:
modname: framedglass

20
.luacheckrc Normal file
View File

@ -0,0 +1,20 @@
globals = {
"framedglass"
}
read_globals = {
-- Stdlib
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},
-- Minetest
"minetest",
"ItemStack",
"dump", "dump2",
"VoxelArea", "vector",
-- deps
"default",
"unifieddyes",
"mtt"
}

View File

@ -142,7 +142,7 @@ if minetest.get_modpath("unifieddyes") then
}
local old_nodes = {}
for k, v in pairs(static_colors) do
for k in pairs(static_colors) do
table.insert(old_nodes, "framedglass:steel_framed_obsidian_glass" .. k)
end
@ -167,3 +167,8 @@ if minetest.get_modpath("unifieddyes") then
end
})
end
if minetest.get_modpath("mtt") and mtt.enabled then
-- validate nodenames
mtt.validate_nodenames(minetest.get_modpath("framedglass") .. "/nodenames.txt")
end

View File

@ -1,2 +1,2 @@
name = framedglass
optional_depends = default, unifieddyes
optional_depends = default, unifieddyes, mtt

5
nodenames.txt Normal file
View File

@ -0,0 +1,5 @@
framedglass:wooden_framed_glass
framedglass:steel_framed_obsidian_glass
framedglass:steel_framed_obsidian_glass_tinted
framedglass:steel_framed_glass
framedglass:wooden_framed_obsidian_glass