blob: 727d28b3bfd63ecbfee080fb3b0c362b9129ceb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
#! /bin/bash
# This script is executed in the travis-ci environment.
set -e
. dist/ansi_color.sh
#disable_color
# Display env (to debug)
echo -en "travis_fold:start:travis_env\r"
printf "$ANSI_YELLOW[TRAVIS] Travis environment $ANSI_NOCOLOR\n"
env | grep TRAVIS
echo -en "travis_fold:end:travis_env\r"
# The command 'git describe' (used for version) needs the history. Get it.
# But the following command fails if the repository is complete.
git fetch --unshallow || true
# Build version.tmp and replace version.in with it (so that the version is
# correctly set).
make -f Makefile.in srcdir=. version.tmp
cp version.tmp src/version.in
# Compute package name
PKG_SHORTCOMMIT="$(printf $TRAVIS_COMMIT | cut -c1-10)"
PKG_VER=`grep Ghdl_Ver src/version.in | sed -e 's/.*"\(.*\)";/\1/'`
PKG_TAG="$TRAVIS_TAG"
if [ -z "$TRAVIS_TAG" ]; then
PKG_TAG="$(date -u +%Y%m%d)-$PKG_SHORTCOMMIT";
fi
if [ "$IMAGE" = "" ]; then
echo "IMAGE not defined"
exit 1
fi
IFS='+' read -ra REFS <<< "$IMAGE"
DDIST=${REFS[0]}
DBLD=${REFS[1]}
DGPL=${REFS[2]}
PKG_NAME="ghdl-${PKG_TAG}-${DBLD}-${DDIST}"
BUILD_CMD="./dist/linux/buildtest.sh $ENABLECOLOR -b $DBLD"
if [ "$DGPL" = "gpl" ]; then
BUILD_CMD="$BUILD_CMD --gpl"
PKG_NAME="ghdl-gpl-${PKG_TAG}"
fi
BUILD_CMD="${BUILD_CMD} -p $PKG_NAME"
echo "build cmd: $BUILD_CMD"
# Build
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Install gnat compiler (use cache)
./dist/macosx/install-ada.sh || exit 1
PATH=$PWD/gnat/bin:$PATH
bash -c "$BUILD_CMD"
else
# Assume linux
# Create docker image
. ./dist/linux/travis-utils.sh
echo "travis_fold:start:create"
travis_time_start
printf "$ANSI_YELLOW[DOCKER build] Docker build $ANSI_NOCOLOR\n"
DOCKERFILE="dist/linux/docker/build-$IMAGE"
echo "dockerfile: $DOCKERFILE"
DOCKER_NAME=`echo $IMAGE | sed -e 's/+/-/g'`
docker build -t $DOCKER_NAME - < $DOCKERFILE
travis_time_finish
echo "travis_fold:end:create"
# Run build+test in docker
docker run --rm --tty --volume $(pwd):/work -w "/work" $DOCKER_NAME bash -c "$BUILD_CMD"
fi
ls -l ghdl-*
if [ ! -f build_ok ]; then
printf "$ANSI_RED[TRAVIS] BUILD failed $ANSI_NOCOLOR\n"
exit 1
fi
|