From 814ebd79e72c334ec884e3949f685c85b9bd7c7b Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:59:56 +0200 Subject: [PATCH] use `mtt` action for integration tests (#361) Co-authored-by: BuckarooBanzay --- .github/workflows/integration-test.yml | 26 ----------------------- .github/workflows/mtt.yml | 15 +++++++++++++ .test/Dockerfile | 17 --------------- .test/minetest.conf | 3 --- README.md | 2 +- docker-compose.yml | 21 ------------------ technic/init.lua | 4 ++-- technic/{integration_test.lua => mtt.lua} | 2 +- {.test => technic}/registered_nodes.txt | 0 9 files changed, 19 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/integration-test.yml create mode 100644 .github/workflows/mtt.yml delete mode 100644 .test/Dockerfile delete mode 100644 .test/minetest.conf delete mode 100644 docker-compose.yml rename technic/{integration_test.lua => mtt.lua} (75%) rename {.test => technic}/registered_nodes.txt (100%) 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/mtt.yml b/.github/workflows/mtt.yml new file mode 100644 index 00000000..5bb12200 --- /dev/null +++ b/.github/workflows/mtt.yml @@ -0,0 +1,15 @@ +name: mtt +on: [push, pull_request] +jobs: + mtt: + 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 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..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/integration-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) 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/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..939c3986 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}) diff --git a/.test/registered_nodes.txt b/technic/registered_nodes.txt similarity index 100% rename from .test/registered_nodes.txt rename to technic/registered_nodes.txt