From a0dd94d5c5a4b1ae4daee5857c8716575e6ff72e Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Thu, 23 Apr 2020 09:46:30 +0200 Subject: [PATCH] add integration test --- .github/workflows/integration-test.yml | 15 +++++ README.md | 4 ++ test/integration-test.sh | 79 ++++++++++++++++++++++++++ test/test_mod/init.lua | 7 +++ test/test_mod/mod.conf | 2 + test/world.mt | 6 ++ 6 files changed, 113 insertions(+) create mode 100644 .github/workflows/integration-test.yml create mode 100755 test/integration-test.sh create mode 100644 test/test_mod/init.lua create mode 100644 test/test_mod/mod.conf create mode 100644 test/world.mt diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000..c9dd6f5 --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,15 @@ +name: integration-test + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@master + + - name: integration-test + run: ./test/integration-test.sh diff --git a/README.md b/README.md index 9df94f9..f824c98 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ Mail mod for Minetest (ingame mod) ====== +![](https://github.com/minetest-mail/mail_mod/workflows/integration-test/badge.svg) +![](https://github.com/minetest-mail/mail_mod/workflows/luacheck/badge.svg) + + This is a fork of cheapies mail mod It adds a mail-system that allows players to send each other messages in-game and via webmail (optional) diff --git a/test/integration-test.sh b/test/integration-test.sh new file mode 100755 index 0000000..4ec5a59 --- /dev/null +++ b/test/integration-test.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +MINETEST_VERSION=5.2.0 + +# prerequisites +jq --version || exit 1 +curl --version || exit 1 + +# ensure proper current directory +CWD=$(dirname $0) +cd ${CWD} + +# setup +unset use_proxy +unset http_proxy +unset https_proxy +unset HTTP_PROXY +unset HTTPS_PROXY + +# run mail-server +docker pull minetestmail/mail +docker run --name mail --rm \ + -e WEBMAILKEY=myserverkey \ + -e WEBMAIL_DEBUG=true \ + --network host \ + minetestmail/mail & + +# wait for startup +bash -c 'while !