-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "Integration test" | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: docker | ||
run: ./test/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local function wait_map(callback) | ||
local pos = vector.new(5, 30, 5) | ||
for y = 0, 4 do | ||
assert(minetest.forceload_block( | ||
vector.new(pos.x, y*16, pos.z), true, -1 | ||
)) | ||
end | ||
|
||
local function check() | ||
if minetest.get_node(pos).name ~= "ignore" then | ||
return callback(pos) | ||
end | ||
minetest.after(0, check) | ||
end | ||
check() | ||
end | ||
|
||
|
||
minetest.after(0, function() | ||
wait_map(function(pos) | ||
for x = -1, 1 do | ||
for z = -1, 1 do | ||
minetest.add_node(pos:offset(x, 0, z), {name="default:dirt"}) | ||
end | ||
end | ||
|
||
pos = pos:offset(0, 1, 0) | ||
minetest.add_entity(pos, "default:rat") | ||
minetest.add_entity(pos, "default:oerkki1") | ||
minetest.add_entity(pos, "default:firefly") | ||
default.spawn_mobv2(pos, default.get_mob_dungeon_master()) | ||
|
||
minetest.after(2.5, function() | ||
minetest.request_shutdown() | ||
end) | ||
end) | ||
end) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mg_name = v6 | ||
minetest_classic_internal_test = true | ||
max_forceloaded_blocks = 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -e | ||
|
||
[ -f game.conf ] || { echo "Must be run in game root folder." >&2; exit 1; } | ||
|
||
[ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="ghcr.io/minetest/minetest:master" | ||
docker run --rm -i \ | ||
-v "$PWD/test/minetest.conf":/etc/minetest/minetest.conf \ | ||
--tmpfs /root/.minetest \ | ||
-v "$PWD":/root/.minetest/games/minetest_classic \ | ||
-v "$PWD/test/world.mt":/root/.minetest/world/world.mt \ | ||
-u 0:0 "$DOCKER_IMAGE" | ||
# -u 0:0 is needed here because MT's image defaults to an unprivileged user | ||
# but all of our mounts are created as root... | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enable_damage = true | ||
creative_mode = false | ||
gameid = minetest_classic |