Skip to content

Commit

Permalink
add luacheck and basic integration test (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: BuckarooBanzay <[email protected]>
  • Loading branch information
BuckarooBanzay and BuckarooBanzay authored Apr 21, 2024
1 parent b002fb8 commit 8a29455
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -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"
}
7 changes: 6 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = framedglass
optional_depends = default, unifieddyes
optional_depends = default, unifieddyes, mtt
5 changes: 5 additions & 0 deletions nodenames.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8a29455

Please sign in to comment.