1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-17 08:20:19 +02:00

Fix Docker CI test to run on new/old engine versions

This commit is contained in:
sfan5 2025-06-13 11:52:28 +02:00
parent 9321c265b6
commit 05d5461a41
2 changed files with 10 additions and 2 deletions

View File

@ -1,11 +1,19 @@
name: test
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
cfg:
- { image: 'ghcr.io/minetest/minetest:5.9.0' }
- { image: 'ghcr.io/minetest/minetest:5.10.0' }
- { image: 'ghcr.io/luanti-org/luanti:master' } # latest git
steps:
- uses: actions/checkout@v4
- run: ./utils/test/run.sh
env:
DOCKER_IMAGE: "${{ matrix.cfg.image }}"

View File

@ -3,6 +3,7 @@ world=$(mktemp -d)
trap 'rm -rf "$world" || :' EXIT
[ -f game.conf ] || { echo "Must be run in game root folder." >&2; exit 1; }
[ -n "$DOCKER_IMAGE" ] || { echo "Specify a docker image." >&2; exit 1; }
chmod -R 777 "$world" # container uses unprivileged user inside
@ -12,7 +13,6 @@ vol=(
-v "$PWD":/var/lib/minetest/.minetest/games/minetest_game
-v "$world":/var/lib/minetest/.minetest/world
)
[ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="ghcr.io/minetest/minetest:master"
docker run --rm -i "${vol[@]}" "$DOCKER_IMAGE" --config /etc/minetest/minetest.conf --gameid minetest
test -f "$world/map.sqlite" || exit 1