-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
100 lines (91 loc) · 3.13 KB
/
.travis.yml
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
96
97
98
99
100
jobs:
include:
- dist: xenial
os: linux
- dist: bionic
os: linux
- os: osx
- os: windows
language: c
compiler: gcc
os: linux
dist: xenial
before_install:
- export FILE_ROOT="mqttkdb"
- export TESTS="False"
- export BUILD="True"
# Run instructions to install the C/C++ requirements (MQTT_INSTALL_DIR) set in place of PAHO_HOME/HDF5_HOME etc.
# Files in this case are unzipped into cbuild within travis_setup.sh
- if [[ $BUILD == "True" ]]; then
chmod +x travis_setup.sh;
./travis_setup.sh;
export MQTT_INSTALL_DIR=$TRAVIS_BUILD_DIR/cbuild
export LIB="build/$FILE_ROOT/lib";
mkdir build;
else
export LIB="";
fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
QLIBDIR=l64; OD=$L64;
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
QLIBDIR=m64; OD=$M64;
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
QLIBDIR=w64; OD=$W64;
else
echo "unknown OS ('$TRAVIS_OS_NAME')" >&2; exit 1;
fi
- export QLIBDIR
- mkdir qhome;
- export QHOME=$(pwd)/qhome;
- export PATH=$QHOME/$QLIBDIR:$PATH;
# Set up q for testing and execute tests on multiple
- if [[ $TESTS == "True" && "x$OD" != "x" && "x$QLIC_KC" != "x" ]]; then
export LD_LIBRARY_PATH=${MQTT_INSTALL_DIR}/lib:$LD_LIBRARY_PATH;
export DYLD_LIBRARY_PATH=${MQTT_INSTALL_DIR}/lib:$LD_LIBRARY_PATH;
export PATH=${MQTT_INSTALL_DIR}/lib:$PATH;
curl -o ${QHOME}/q.zip -L $OD;
unzip -d ${QHOME} ${QHOME}/q.zip;
rm ${QHOME}/q.zip;
echo -n $QLIC_KC |base64 --decode > ${QHOME}/kc.lic;
else
echo No kdb+, no tests;
fi
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
export FILE_TAIL="zip";
else
export FILE_TAIL="tgz";
fi
- export FILE_NAME=$FILE_ROOT-$TRAVIS_OS_NAME-$TRAVIS_BRANCH.$FILE_TAIL
# Make binaries for the library as appropriate
- if [[ $BUILD == "True" && $TRAVIS_OS_NAME == "windows" ]]; then
cd build;
cmake -G "Visual Studio 15 2017 Win64" --config Release .. ;
cmake --build . --config Release --target install;
cd ..;
elif [[ $BUILD == "True" && ( $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ) ]]; then
cd build;
cmake ..;
cmake --build . --target install;
cd ..;
fi
script:
- if [[ $TESTS == "True" && "x$OD" != "x" && "x$QLIC_KC" != "x" ]]; then
q test.q tests/ -q;
fi
- if [[ $TRAVIS_OS_NAME == "windows" && $BUILD == "True" ]]; then
7z a -tzip -r $FILE_NAME ./build/$FILE_ROOT/*;
elif [[ $BUILD == "True" && ( $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ) ]]; then
tar -zcvf $FILE_NAME -C build/$FILE_ROOT .;
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
7z a -tzip $FILE_NAME README.md install.bat LICENSE q examples docs;
elif [[ $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ]]; then
tar -zcvf $FILE_NAME README.md install.sh LICENSE q examples docs;
fi
deploy:
provider: releases
token: "$GITHUB_APIKEY"
file: "$FILE_NAME"
on:
tags: true
condition: $TRAVIS_OS_NAME = windows || $TRAVIS_OS_NAME = osx || ($TRAVIS_DIST = xenial && $TRAVIS_OS_NAME = linux)
skip_cleanup: 'true'