summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml12
-rwxr-xr-x.tools/downloadlib.sh22
-rwxr-xr-x.tools/manaplus.sh33
-rwxr-xr-x.tools/retry.sh15
4 files changed, 81 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d6f65f8c..f4a2cad6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -35,6 +35,16 @@ licensecheck:
script:
- ./.tools/licensecheck.sh
+manaplus:
+ stage: test
+ script:
+ - ./.tools/manaplus.sh
+ artifacts:
+ paths:
+ - shared
+ when: always
+ expire_in: 3 week
+
pages:
stage: deploy
script:
@@ -45,7 +55,7 @@ pages:
- public
only:
- master
-
+
ok_job:
stage: ok
script:
diff --git a/.tools/downloadlib.sh b/.tools/downloadlib.sh
new file mode 100755
index 00000000..b9a50d73
--- /dev/null
+++ b/.tools/downloadlib.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+export zipname="lib.zip"
+export libname="$1_$2"
+
+mkdir libdownload
+cd libdownload
+rm "${zipname}"
+../client-data/.tools/retry.sh wget -O "${zipname}" "https://gitlab.com/simplepackagemanager/spm/builds/artifacts/$1/download?job=${libname}"
+unzip "${zipname}"
+cp -r "bin/${libname}" ..
+cd ..
+
+rm -rf /usr/local/spm/bin/${libname}
+mkdir -p /usr/local/spm/bin
+
+cp -r libdownload/bin/${libname} /usr/local/spm/bin/
+ls /usr/local/spm/bin/${libname}
+if [ "$?" != 0 ]; then
+ echo "Library $1 $2 unpack failed"
+ exit 1
+fi
diff --git a/.tools/manaplus.sh b/.tools/manaplus.sh
new file mode 100755
index 00000000..aeb39a86
--- /dev/null
+++ b/.tools/manaplus.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+source ./.tools/init.sh
+
+clientdata_init
+
+aptget_update
+aptget_install gcc g++ \
+ make autoconf automake autopoint gettext \
+ libxml2-dev libcurl4-gnutls-dev libpng-dev \
+ libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev \
+ wget unzip
+
+pwd
+ls
+
+./clientdata/.tools/downloadlib.sh manaplus master || exit 1
+
+export HOME=`pwd`/clientdata/shared
+
+cd manaplus_master || exit 1
+export SDL_VIDEODRIVER=dummy
+./bin/manaplus --validate -u -d ../clientdata || exit 1
+
+ls "${HOME}/.local/share/mana/manaplus.log" || exit 1
+grep -A 10 "Assert:" "${HOME}/.local/share/mana/manaplus.log"
+
+if [ "$?" == 0 ]; then
+ echo "Asserts found"
+ exit 1
+fi
+
+cd ..
diff --git a/.tools/retry.sh b/.tools/retry.sh
new file mode 100755
index 00000000..aaa50e98
--- /dev/null
+++ b/.tools/retry.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+n=0
+
+while true; do
+ $*
+ if [ "$?" == 0 ]; then
+ exit 0
+ fi
+ if [[ $n -ge 10 ]]; then
+ exit -1
+ fi
+ sleep 5s
+ n=$((n+1))
+done