-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smoke test with engine using Docker
- Loading branch information
Showing
5 changed files
with
71 additions
and
4 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
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,26 @@ | ||
on: [push, pull_request] | ||
name: "Test" | ||
|
||
jobs: | ||
test: | ||
name: "Smoke Test ${{ matrix.cfg.image }}" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
cfg: | ||
- { image: 'registry.gitlab.com/minetest/minetest/server:5.0.1', mtg: false } | ||
- { image: 'ghcr.io/minetest/minetest:master:5.9.0', mtg: true } | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- uses: actions/checkout@main | ||
with: | ||
repository: 'minetest/minetest_game' | ||
path: minetest_game | ||
if: ${{ matrix.cfg.mtg }} | ||
|
||
- name: Run tests | ||
run: ./.test/run.sh | ||
env: | ||
DOCKER_IMAGE: "${{ matrix.cfg.image }}" |
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 = singlenode | ||
mesecon.internal_test = true | ||
random_mod_load_order = true |
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,30 @@ | ||
#!/bin/bash | ||
tempdir=$(mktemp -d) | ||
confpath=$tempdir/minetest.conf | ||
worldpath=$tempdir/world | ||
trap 'rm -rf "$tempdir" || :' EXIT | ||
|
||
[ -f mesecons/mod.conf ] || { echo "Must be run in modpack root folder." >&2; exit 1; } | ||
|
||
command -v docker >/dev/null || { echo "Docker is not installed." >&2; exit 1; } | ||
[ -d minetest_game ] || echo "A source checkout of minetest_game was not found. This can fail if your docker image does not ship a game." >&2 | ||
|
||
mkdir "$worldpath" | ||
cp -v .test/minetest.conf "$confpath" | ||
chmod -R 777 "$tempdir" | ||
|
||
args=( | ||
-v "$confpath":/etc/minetest/minetest.conf | ||
-v "$tempdir":/var/lib/minetest/.minetest | ||
-v "$PWD":/var/lib/minetest/.minetest/world/worldmods/mesecons | ||
) | ||
[ -d minetest_game ] && args+=( | ||
-v "$PWD/minetest_game":/var/lib/minetest/.minetest/games/minetest_game | ||
) | ||
args+=("$DOCKER_IMAGE") | ||
[ -d minetest_game ] && args+=(--gameid minetest --verbose) | ||
docker run --rm -i "${args[@]}" | ||
|
||
ls -la "$worldpath" | ||
test -f "$worldpath/mesecon_actionqueue" || exit 1 | ||
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