From 8ea38b8bebdae3555549b1c77874ec668f8f1d3a Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 21 Apr 2024 18:07:47 +0200 Subject: [PATCH 1/4] use `mtt` action for integration tests --- .github/workflows/integration-test.yml | 26 ------------------- .github/workflows/test.yml | 16 ++++++++++++ .test/Dockerfile | 17 ------------ .test/minetest.conf | 3 --- README.md | 2 +- docker-compose.yml | 21 --------------- ...gistered_nodes.txt => registered_nodes.txt | 0 technic/init.lua | 4 +-- technic/{integration_test.lua => mtt.lua} | 2 +- 9 files changed, 20 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/integration-test.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .test/Dockerfile delete mode 100644 .test/minetest.conf delete mode 100644 docker-compose.yml rename .test/registered_nodes.txt => registered_nodes.txt (100%) rename technic/{integration_test.lua => mtt.lua} (75%) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml deleted file mode 100644 index 6dcb4ab5..00000000 --- a/.github/workflows/integration-test.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: integration-test - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - matrix: - include: - - ENGINE_IMAGE: registry.gitlab.com/minetest/minetest/server:5.5.0 - MTG_VERSION: "5.5.0" - - ENGINE_IMAGE: ghcr.io/minetest-hosting/minetest-docker:5.8.0 - MTG_VERSION: "5.8.0" - - ENGINE_IMAGE: ghcr.io/minetest-hosting/minetest-docker:main - MTG_VERSION: master - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - submodules: recursive - - name: test - run: docker-compose up --exit-code-from test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..d11061c1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,16 @@ +name: test +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: buckaroobanzay/mtt@main + with: + modname: technic + git_dependencies: | + https://github.com/mt-mods/basic_materials.git + https://github.com/mt-mods/pipeworks.git + https://github.com/minetest-mods/moreores.git + https://github.com/mt-mods/xcompat.git + - uses: coverallsapp/github-action@v1 \ No newline at end of file diff --git a/.test/Dockerfile b/.test/Dockerfile deleted file mode 100644 index a42647c2..00000000 --- a/.test/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG ENGINE_IMAGE=ghcr.io/minetest-hosting/minetest-docker:5.8.0 - -FROM ${ENGINE_IMAGE} -ARG MTG_VERSION=master -USER root -RUN apk add git &&\ - mkdir -p /root/.minetest/worlds/world/worldmods/ &&\ - cd /root/.minetest/worlds/world/worldmods/ &&\ - git clone --depth 1 https://github.com/BuckarooBanzay/mtt &&\ - git clone --recurse-submodules --depth 1 https://github.com/mt-mods/basic_materials.git &&\ - git clone --depth 1 https://github.com/mt-mods/pipeworks.git &&\ - git clone --depth 1 https://github.com/minetest-mods/moreores.git &&\ - git clone --depth 1 https://github.com/mt-mods/xcompat.git &&\ - mkdir /root/.minetest/games &&\ - git clone https://github.com/minetest/minetest_game.git /root/.minetest/games/minetest &&\ - cd /root/.minetest/games/minetest &&\ - git checkout ${MTG_VERSION} diff --git a/.test/minetest.conf b/.test/minetest.conf deleted file mode 100644 index bd46a464..00000000 --- a/.test/minetest.conf +++ /dev/null @@ -1,3 +0,0 @@ -mg_name = v7 -mtt_enable = true -deprecated_lua_api_handling = error \ No newline at end of file diff --git a/README.md b/README.md index 9752c600..c3560a03 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Technic A mod for [minetest](http://www.minetest.net) -![integration-test](https://github.com/mt-mods/technic/workflows/integration-test/badge.svg) +![integration-test](https://github.com/mt-mods/technic/workflows/test/badge.svg) ![luacheck](https://github.com/mt-mods/technic/workflows/luacheck/badge.svg) ![mineunit](https://github.com/mt-mods/technic/workflows/mineunit/badge.svg) ![](https://byob.yarr.is/mt-mods/technic/coverage) diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 27c8c26d..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "3.6" - -services: - test: - build: - context: ./.test - args: - ENGINE_IMAGE: ${ENGINE_IMAGE:-ghcr.io/minetest-hosting/minetest-docker:5.8.0} - MTG_VERSION: ${MTG_VERSION:-5.8.0} - entrypoint: "minetestserver --config /minetest.conf --gameid minetest" - user: root - volumes: - - "./:/root/.minetest/worlds/world/worldmods/technic/" - - "./.test/minetest.conf:/minetest.conf" - - "./.test/registered_nodes.txt:/root/.minetest/worlds/world/registered_nodes.txt" - - "world:/root/.minetest/worlds/world" - ports: - - "30000:30000/udp" - -volumes: - world: {} \ No newline at end of file diff --git a/.test/registered_nodes.txt b/registered_nodes.txt similarity index 100% rename from .test/registered_nodes.txt rename to registered_nodes.txt diff --git a/technic/init.lua b/technic/init.lua index 22d99d4d..2d440445 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -60,6 +60,6 @@ dofile(modpath.."/effects.lua") -- Chat commands dofile(modpath.."/chatcommands.lua") -if minetest.get_modpath("mtt") then - dofile(modpath.."/integration_test.lua") +if minetest.get_modpath("mtt") and mtt.enabled then + dofile(modpath.."/mtt.lua") end diff --git a/technic/integration_test.lua b/technic/mtt.lua similarity index 75% rename from technic/integration_test.lua rename to technic/mtt.lua index aaeded3f..7bfd31de 100644 --- a/technic/integration_test.lua +++ b/technic/mtt.lua @@ -1,6 +1,6 @@ -- check if all required nodenames are registered -mtt.validate_nodenames(minetest.get_worldpath().."/registered_nodes.txt") +mtt.validate_nodenames(minetest.get_modpath("technic").."/../registered_nodes.txt") -- test mapgen mtt.emerge_area({x=0, y=0, z=0}, {x=48, y=48, z=48}) From 89ad25823d841073f73c1d02e5bd403fd19243d9 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 21 Apr 2024 18:09:02 +0200 Subject: [PATCH 2/4] move registered_nodes file to `technic` mod --- technic/mtt.lua | 2 +- registered_nodes.txt => technic/registered_nodes.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename registered_nodes.txt => technic/registered_nodes.txt (100%) diff --git a/technic/mtt.lua b/technic/mtt.lua index 7bfd31de..939c3986 100644 --- a/technic/mtt.lua +++ b/technic/mtt.lua @@ -1,6 +1,6 @@ -- check if all required nodenames are registered -mtt.validate_nodenames(minetest.get_modpath("technic").."/../registered_nodes.txt") +mtt.validate_nodenames(minetest.get_modpath("technic").."/registered_nodes.txt") -- test mapgen mtt.emerge_area({x=0, y=0, z=0}, {x=48, y=48, z=48}) diff --git a/registered_nodes.txt b/technic/registered_nodes.txt similarity index 100% rename from registered_nodes.txt rename to technic/registered_nodes.txt From 2bf7e59f16ceb4b54c5e02e19caae9ed6d679b97 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 21 Apr 2024 18:09:57 +0200 Subject: [PATCH 3/4] remove coverage step --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d11061c1..4e9acc89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,4 +13,3 @@ jobs: https://github.com/mt-mods/pipeworks.git https://github.com/minetest-mods/moreores.git https://github.com/mt-mods/xcompat.git - - uses: coverallsapp/github-action@v1 \ No newline at end of file From bf4205c6e11087646b7007e2687849a2ee464853 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Fri, 26 Apr 2024 16:55:26 +0200 Subject: [PATCH 4/4] rename "test" to "mtt" --- .github/workflows/{test.yml => mtt.yml} | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{test.yml => mtt.yml} (95%) diff --git a/.github/workflows/test.yml b/.github/workflows/mtt.yml similarity index 95% rename from .github/workflows/test.yml rename to .github/workflows/mtt.yml index 4e9acc89..5bb12200 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/mtt.yml @@ -1,7 +1,7 @@ -name: test +name: mtt on: [push, pull_request] jobs: - test: + mtt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index c3560a03..3611813f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Technic A mod for [minetest](http://www.minetest.net) -![integration-test](https://github.com/mt-mods/technic/workflows/test/badge.svg) +![mtt](https://github.com/mt-mods/technic/workflows/mtt/badge.svg) ![luacheck](https://github.com/mt-mods/technic/workflows/luacheck/badge.svg) ![mineunit](https://github.com/mt-mods/technic/workflows/mineunit/badge.svg) ![](https://byob.yarr.is/mt-mods/technic/coverage)