generate.sh 2.07 KB
Newer Older
1
#!/bin/sh
2
3
4
5
6
# tarot implements the rules of the tarot game
# Copyright (C) 2019  Vivien Kraus

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation, version 3 of the License.
8
9
10
11
12
13
14
15
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17
18
19
20

apt-get update
apt-get upgrade -y
apt-get install -y \
	build-essential \
21
	curl \
22
	git \
23
	guile-2.2-dev \
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	libcairo2-dev \
	libgirepository1.0-dev \
	libglib2.0-dev \
	libgtk-3-dev \
	libxml2 \
	libxml2-dev \
	nettle-dev \
	parallel \
	pkg-config \
	valgrind

VERSION=$(cat dist/version)

cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../tarot-$VERSION/configure \
    --enable-silent-rules=yes \
    --enable-valgrind=yes \
    || (cat config.log; exit 1)
make -j 16 || exit 1
make install || exit 1

export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

mkdir /root/.ssh || exit 1
echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
chmod go-rwx /root/.ssh/id_rsa || exit 1
git config --global user.email "vivien@planete-kraus.eu" || exit 1
git config --global user.name "Gitlab CI for the tarot package" || exit 1
git clone git@framagit.org:play-tarot/datasets.git dataset/ || exit 1

rm -rf dataset/generated/mcts

mkdir -p dataset/generated/mcts || exit 1
mkdir -p dataset/generated/stacking || exit 1

Vivien Kraus's avatar
Vivien Kraus committed
65
seq 1 10 | parallel ../tarot-$VERSION/ci/generate-seed.sh {}
Vivien Kraus's avatar
Vivien Kraus committed
66
67
68
69
70
71
72
73
for check in /tmp/all-*-*-failed
do
    if test "x$(cat $check)" != "xno"
    then
	echo "Could not generate anything for test '$check'."
	exit 1
    fi
done