mtt action
This commit is contained in:
parent
49703e7386
commit
3e8b92d196
|
@ -1,15 +0,0 @@
|
||||||
name: integration-test
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
|
|
||||||
- name: integration-test
|
|
||||||
run: ./test/integration-test.sh
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: test
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: buckaroobanzay/mtt@main
|
||||||
|
with:
|
||||||
|
modname: scifi_nodes
|
||||||
|
- uses: coverallsapp/github-action@v1
|
|
@ -24,5 +24,6 @@ read_globals = {
|
||||||
"unifieddyes",
|
"unifieddyes",
|
||||||
"letters",
|
"letters",
|
||||||
"stealthnode",
|
"stealthnode",
|
||||||
"slats"
|
"slats",
|
||||||
|
"mtt"
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# scifi_nodes
|
# scifi_nodes
|
||||||
|
|
||||||
![](https://github.com/D00Med/scifi_nodes/workflows/luacheck/badge.svg)
|
![](https://github.com/D00Med/scifi_nodes/workflows/luacheck/badge.svg)
|
||||||
![](https://github.com/D00Med/scifi_nodes/workflows/integration-test/badge.svg)
|
![](https://github.com/D00Med/scifi_nodes/workflows/test/badge.svg)
|
||||||
[![ContentDB](https://content.minetest.net/packages/D00Med/scifi_nodes/shields/downloads/)](https://content.minetest.net/packages/D00Med/scifi_nodes/)
|
[![ContentDB](https://content.minetest.net/packages/D00Med/scifi_nodes/shields/downloads/)](https://content.minetest.net/packages/D00Med/scifi_nodes/)
|
||||||
|
|
||||||
Minetest mod that adds scifi themed blocks, doors, materials, plants and other assets.
|
Minetest mod that adds scifi themed blocks, doors, materials, plants and other assets.
|
||||||
|
|
4
init.lua
4
init.lua
|
@ -42,3 +42,7 @@ if minetest.get_modpath("mesecons_stealthnode") then
|
||||||
-- register stealthnodes
|
-- register stealthnodes
|
||||||
dofile(MP.."/stealthnodes.lua")
|
dofile(MP.."/stealthnodes.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("mtt") and mtt.enabled then
|
||||||
|
dofile(MP .. "/mtt.lua")
|
||||||
|
end
|
1
mod.conf
1
mod.conf
|
@ -14,5 +14,6 @@ dye,
|
||||||
unifieddyes,
|
unifieddyes,
|
||||||
letters,
|
letters,
|
||||||
mesecons_stealthnode,
|
mesecons_stealthnode,
|
||||||
|
mtt,
|
||||||
slats
|
slats
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
mtt.validate_nodenames(minetest.get_modpath("scifi_nodes") .. "/nodenames.txt")
|
File diff suppressed because it is too large
Load Diff
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# Spins up a test world to ensure proper working recipes and registrations
|
|
||||||
|
|
||||||
CWD=$(dirname $0)
|
|
||||||
cd ${CWD}/../
|
|
||||||
|
|
||||||
CFG=/tmp/minetest.conf
|
|
||||||
MTDIR=/tmp/mt
|
|
||||||
WORLDDIR=${MTDIR}/worlds/world
|
|
||||||
|
|
||||||
cat <<EOF > ${CFG}
|
|
||||||
# empty
|
|
||||||
EOF
|
|
||||||
|
|
||||||
mkdir -p ${WORLDDIR}
|
|
||||||
chmod 777 ${MTDIR} -R
|
|
||||||
docker run --rm -i \
|
|
||||||
-v ${CFG}:/etc/minetest/minetest.conf:ro \
|
|
||||||
-v ${MTDIR}:/var/lib/minetest/.minetest \
|
|
||||||
-v $(pwd)/:/var/lib/minetest/.minetest/worlds/world/worldmods/scifi_nodes \
|
|
||||||
-v $(pwd)/test/test_mod/:/var/lib/minetest/.minetest/worlds/world/worldmods/scifi_nodes_test \
|
|
||||||
--network host \
|
|
||||||
registry.gitlab.com/minetest/minetest/server:5.2.0
|
|
||||||
|
|
||||||
test -f ${WORLDDIR}/integration_test.json && exit 0 || exit 1
|
|
|
@ -1,40 +0,0 @@
|
||||||
|
|
||||||
minetest.log("warning", "[TEST] integration-test enabled!")
|
|
||||||
|
|
||||||
-- those mods have to be present
|
|
||||||
local assert_mods = {
|
|
||||||
"scifi_nodes"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- those nodes have to be present
|
|
||||||
local assert_nodes = {
|
|
||||||
"scifi_nodes:crate",
|
|
||||||
"scifi_nodes:door1a"
|
|
||||||
}
|
|
||||||
|
|
||||||
minetest.register_on_mods_loaded(function()
|
|
||||||
minetest.after(0, function()
|
|
||||||
-- check mods
|
|
||||||
for _, modname in ipairs(assert_mods) do
|
|
||||||
if not minetest.get_modpath(modname) then
|
|
||||||
error("Mod not present: " .. modname)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- check nodes
|
|
||||||
for _, nodename in ipairs(assert_nodes) do
|
|
||||||
if not minetest.registered_nodes[nodename] then
|
|
||||||
error("Node not present: " .. nodename)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = minetest.write_json({ success = true }, true);
|
|
||||||
local file = io.open(minetest.get_worldpath().."/integration_test.json", "w" );
|
|
||||||
if file then
|
|
||||||
file:write(data)
|
|
||||||
file:close()
|
|
||||||
end
|
|
||||||
minetest.request_shutdown("success")
|
|
||||||
|
|
||||||
end)
|
|
||||||
end)
|
|
|
@ -1,2 +0,0 @@
|
||||||
name = scifi_nodes_test
|
|
||||||
depends = scifi_nodes
|
|
Loading…
Reference in New Issue