From 4bbe29fcd3d4ca8174316517376fba1b883cfa1a Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:36:24 +0200 Subject: [PATCH] mtt action (#83) * mtt action * nodename * remove coverage step * re-enable coverage * add coverage badge --------- Co-authored-by: BuckarooBanzay --- .github/workflows/integration-test.yml | 15 -- .github/workflows/test.yml | 12 ++ .luacheckrc | 3 +- README.md | 3 +- init.lua | 4 + mod.conf | 1 + mtt.lua | 2 + nodenames.txt | 246 +++++++++++++++++++++++++ test/integration-test.sh | 25 --- test/test_mod/init.lua | 40 ---- test/test_mod/mod.conf | 2 - 11 files changed, 269 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/integration-test.yml create mode 100644 .github/workflows/test.yml create mode 100644 mtt.lua create mode 100644 nodenames.txt delete mode 100755 test/integration-test.sh delete mode 100644 test/test_mod/init.lua delete mode 100644 test/test_mod/mod.conf diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml deleted file mode 100644 index 2d00698..0000000 --- a/.github/workflows/integration-test.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..73b4ca1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,12 @@ +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 + enable_coverage: "true" + - uses: coverallsapp/github-action@v1 \ No newline at end of file diff --git a/.luacheckrc b/.luacheckrc index e1c1bc6..ab44472 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -24,5 +24,6 @@ read_globals = { "unifieddyes", "letters", "stealthnode", - "slats" + "slats", + "mtt" } diff --git a/README.md b/README.md index dfc5ef8..c0b6d47 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ # 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) +[![Coverage Status](https://coveralls.io/repos/github/D00Med/scifi_nodes/badge.svg?branch=master)](https://coveralls.io/github/D00Med/scifi_nodes?branch=master) [![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. diff --git a/init.lua b/init.lua index fef8fba..f9f0696 100644 --- a/init.lua +++ b/init.lua @@ -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 \ No newline at end of file diff --git a/mod.conf b/mod.conf index 5570676..8a4629e 100644 --- a/mod.conf +++ b/mod.conf @@ -14,5 +14,6 @@ dye, unifieddyes, letters, mesecons_stealthnode, +mtt, slats """ diff --git a/mtt.lua b/mtt.lua new file mode 100644 index 0000000..68e9a4d --- /dev/null +++ b/mtt.lua @@ -0,0 +1,2 @@ + +mtt.validate_nodenames(minetest.get_modpath("scifi_nodes") .. "/nodenames.txt") diff --git a/nodenames.txt b/nodenames.txt new file mode 100644 index 0000000..3c26c73 --- /dev/null +++ b/nodenames.txt @@ -0,0 +1,246 @@ +scifi_nodes:liquid_pipe +scifi_nodes:light +scifi_nodes:blackdmg +scifi_nodes:bluemetal +scifi_nodes:blackpipe +scifi_nodes:white_pad +scifi_nodes:green_light +scifi_nodes:glass +scifi_nodes:pad +scifi_nodes:rough +scifi_nodes:protected_switch_on +scifi_nodes:rock +scifi_nodes:greentubes +scifi_nodes:slope_gblock +scifi_nodes:greytile +scifi_nodes:dent +scifi_nodes:screen2 +scifi_nodes:octbl_pane_offset +scifi_nodes:octppl_pane_offset +scifi_nodes:grnpipe +scifi_nodes:doomengine +scifi_nodes:egg +scifi_nodes:ultra_white +scifi_nodes:octppl_pane_double +scifi_nodes:cover +scifi_nodes:laptop_closed +scifi_nodes:discs +scifi_nodes:switch_on +scifi_nodes:Doom_door_closed +scifi_nodes:glass_pane +scifi_nodes:disc +scifi_nodes:whtlightbnd +scifi_nodes:light_dynamic +scifi_nodes:slope_wallpipe +scifi_nodes:greenbar +scifi_nodes:blue_square +scifi_nodes:blumetlight +scifi_nodes:white_door_opened +scifi_nodes:blue_door_closed +scifi_nodes:pipeside +scifi_nodes:keysmonitor +scifi_nodes:slope_pipe +scifi_nodes:grass +scifi_nodes:slope_alien +scifi_nodes:doomwall3 +scifi_nodes:blumetstr +scifi_nodes:doomwall42 +scifi_nodes:blue +scifi_nodes:greenlights2 +scifi_nodes:slope_black +scifi_nodes:plant10 +scifi_nodes:plant2 +scifi_nodes:blklt2 +scifi_nodes:plant9 +scifi_nodes:screen +scifi_nodes:purple +scifi_nodes:white_door_closed +scifi_nodes:lightstp +scifi_nodes:slope_stripes +scifi_nodes:pplwndw +scifi_nodes:crate +scifi_nodes:octrng_pane_double +scifi_nodes:widescreen +scifi_nodes:blue_door_closed_top +scifi_nodes:slope_white2 +scifi_nodes:table +scifi_nodes:green_door_opened +scifi_nodes:flower1 +scifi_nodes:grnpipe2 +scifi_nodes:slope_mesh +scifi_nodes:rock2 +scifi_nodes:blackdmgstripe +scifi_nodes:ppllght +scifi_nodes:grey_square +scifi_nodes:plant6 +scifi_nodes:powered_stand +scifi_nodes:pot +scifi_nodes:wall +scifi_nodes:greygreenbar +scifi_nodes:greenmetal +scifi_nodes:blacktile2 +scifi_nodes:blackoct +scifi_nodes:black +scifi_nodes:slope_ultra_white +scifi_nodes:lighttop +scifi_nodes:blackplate +scifi_nodes:doomwall43 +scifi_nodes:green_square +scifi_nodes:Doom_door_closed_top +scifi_nodes:box +scifi_nodes:green +scifi_nodes:plant8 +scifi_nodes:whiteoct +scifi_nodes:wallpipe +scifi_nodes:flower4 +scifi_nodes:slope_bluebars +scifi_nodes:engine +scifi_nodes:glass_pane_double +scifi_nodes:blacktile +scifi_nodes:glassscreen +scifi_nodes:octrng +scifi_nodes:plant1 +scifi_nodes:computer +scifi_nodes:grassblk +scifi_nodes:tower +scifi_nodes:builder +scifi_nodes:pplwll2 +scifi_nodes:doomwall431 +scifi_nodes:black_screen +scifi_nodes:doomwall44 +scifi_nodes:windowstraight2 +scifi_nodes:gblock3 +scifi_nodes:octgrn_pane_offset +scifi_nodes:glass_pane_offset +scifi_nodes:octppl_pane +scifi_nodes:octbl_pane_double +scifi_nodes:octgrn_pane_double +scifi_nodes:octgrn_pane +scifi_nodes:octrng_pane_offset +scifi_nodes:octrng_pane +scifi_nodes:digicode_off +scifi_nodes:octppl +scifi_nodes:digicode_on +scifi_nodes:palm_scanner_checking +scifi_nodes:palm_scanner_off +scifi_nodes:windowpanel +scifi_nodes:slope_vent +scifi_nodes:tallscreen +scifi_nodes:itemholder +scifi_nodes:capsule2 +scifi_nodes:capsule3 +scifi_nodes:slope_wall +scifi_nodes:slope_blklt2 +scifi_nodes:plant5 +scifi_nodes:slope_screen +scifi_nodes:windowcorner2 +scifi_nodes:windowstraight +scifi_nodes:windowcorner +scifi_nodes:pipen +scifi_nodes:laptop_open +scifi_nodes:mesh2 +scifi_nodes:microscope +scifi_nodes:liquid_pipe2 +scifi_nodes:lightbars +scifi_nodes:doomwall4 +scifi_nodes:lightbar +scifi_nodes:plant_trap +scifi_nodes:slope_purple +scifi_nodes:gloshroom +scifi_nodes:blue_door_opened_top +scifi_nodes:greenbar_animated +scifi_nodes:blue_door_opened +scifi_nodes:tile +scifi_nodes:flower3 +scifi_nodes:green_door_opened_top +scifi_nodes:green_door_closed_top +scifi_nodes:blackvent +scifi_nodes:white_door_opened_top +scifi_nodes:white_door_closed_top +scifi_nodes:black_door_opened_top +scifi_nodes:black_door_opened +scifi_nodes:white_base +scifi_nodes:black_door_closed_top +scifi_nodes:black_door_closed +scifi_nodes:Doom_door_opened_top +scifi_nodes:stripes +scifi_nodes:Doom_door_opened +scifi_nodes:bluebars +scifi_nodes:doomwall41 +scifi_nodes:green2 +scifi_nodes:whitetile +scifi_nodes:rust +scifi_nodes:slope_glight +scifi_nodes:fan +scifi_nodes:red_square +scifi_nodes:greydots +scifi_nodes:green_door_closed +scifi_nodes:greenlights +scifi_nodes:mesh +scifi_nodes:black_mesh +scifi_nodes:gblock2 +scifi_nodes:stripes2top +scifi_nodes:greybolts +scifi_nodes:octofloor +scifi_nodes:pplwll3 +scifi_nodes:red +scifi_nodes:greenmetal2 +scifi_nodes:junk +scifi_nodes:red_light +scifi_nodes:pplblk +scifi_nodes:super_white +scifi_nodes:bluwllight +scifi_nodes:blackvnt +scifi_nodes:pplwll4 +scifi_nodes:slope_holes +scifi_nodes:vent2 +scifi_nodes:bluetile +scifi_nodes:eyetree +scifi_nodes:octgrn +scifi_nodes:capsule +scifi_nodes:slope_bluemetal +scifi_nodes:slope_super_white +scifi_nodes:switch_off +scifi_nodes:octbl +scifi_nodes:doomlight +scifi_nodes:white2 +scifi_nodes:forcefield +scifi_nodes:alienslope +scifi_nodes:slope_white +scifi_nodes:plant3 +scifi_nodes:slope_mesh2 +scifi_nodes:screen3 +scifi_nodes:pipe +scifi_nodes:black_detail +scifi_nodes:slope_lightstripe +scifi_nodes:slope_blight +scifi_nodes:ladder +scifi_nodes:protected_switch_off +scifi_nodes:rfloor +scifi_nodes:white +scifi_nodes:gblock +scifi_nodes:octofloor2 +scifi_nodes:slope_rough +scifi_nodes:octbl_pane +scifi_nodes:bluegrid +scifi_nodes:pot_lid +scifi_nodes:slope_rlight +scifi_nodes:bfloor +scifi_nodes:plant4 +scifi_nodes:pot2 +scifi_nodes:greybars +scifi_nodes:doomwall1 +scifi_nodes:holes +scifi_nodes:black_lights +scifi_nodes:palm_scanner_on +scifi_nodes:plant7 +scifi_nodes:flower2 +scifi_nodes:slope_greenmetal +scifi_nodes:blink +scifi_nodes:slope_grey +scifi_nodes:grey +scifi_nodes:pplwll +scifi_nodes:stripes2 +scifi_nodes:slope_blight2 +scifi_nodes:monitorwall +scifi_nodes:doomwall2 diff --git a/test/integration-test.sh b/test/integration-test.sh deleted file mode 100755 index d3b8429..0000000 --- a/test/integration-test.sh +++ /dev/null @@ -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 < ${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 diff --git a/test/test_mod/init.lua b/test/test_mod/init.lua deleted file mode 100644 index 7b986fa..0000000 --- a/test/test_mod/init.lua +++ /dev/null @@ -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) diff --git a/test/test_mod/mod.conf b/test/test_mod/mod.conf deleted file mode 100644 index 8065d95..0000000 --- a/test/test_mod/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name = scifi_nodes_test -depends = scifi_nodes