use mtt action for integration tests (#361)

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
This commit is contained in:
Buckaroo Banzai 2024-04-26 16:59:56 +02:00 committed by GitHub
parent ad2c11ed9d
commit 814ebd79e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 19 additions and 71 deletions

View File

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

15
.github/workflows/mtt.yml vendored Normal file
View File

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

View File

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

View File

@ -1,3 +0,0 @@
mg_name = v7
mtt_enable = true
deprecated_lua_api_handling = error

View File

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

View File

@ -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: {}

View File

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

View File

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