mtt action

This commit is contained in:
BuckarooBanzay 2024-04-19 07:44:35 +02:00
parent 49703e7386
commit 3e8b92d196
11 changed files with 9496 additions and 84 deletions

View File

@ -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

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

@ -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

View File

@ -24,5 +24,6 @@ read_globals = {
"unifieddyes",
"letters",
"stealthnode",
"slats"
"slats",
"mtt"
}

View File

@ -3,7 +3,7 @@
# scifi_nodes
![](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/)
Minetest mod that adds scifi themed blocks, doors, materials, plants and other assets.

View File

@ -41,4 +41,8 @@ end
if minetest.get_modpath("mesecons_stealthnode") then
-- register stealthnodes
dofile(MP.."/stealthnodes.lua")
end
if minetest.get_modpath("mtt") and mtt.enabled then
dofile(MP .. "/mtt.lua")
end

View File

@ -14,5 +14,6 @@ dye,
unifieddyes,
letters,
mesecons_stealthnode,
mtt,
slats
"""

2
mtt.lua Normal file
View File

@ -0,0 +1,2 @@
mtt.validate_nodenames(minetest.get_modpath("scifi_nodes") .. "/nodenames.txt")

9475
nodenames.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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)

View File

@ -1,2 +0,0 @@
name = scifi_nodes_test
depends = scifi_nodes