forked from KxSystems/mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
100 lines (91 loc) · 3.27 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: trusty
os: linux
- dist: bionic
os: linux
- os: osx
- os: windows
language: c
compiler: gcc
os: linux
dist: xenial
before_install:
- export FILE_ROOT="mqtt"
- export TESTS="False"
- export BUILD="True"
# Run instructions to install the C/C++ requirements (BUILD_HOME) 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 BUILD_HOME=$TRAVIS_BUILD_DIR/cbuild
export LIB="cmake/$FILE_ROOT/lib";
mkdir cmake;
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=$BUILD_HOME/lib:$LD_LIBRARY_PATH;
export DYLD_LIBRARY_PATH=$BUILD_HOME/lib:$LD_LIBRARY_PATH;
export PATH=$BUILD_HOME/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 cmake && cmake -G "Visual Studio 15 2017 Win64" .. ;
export MSBUILD_PATH="/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/";
export PATH=$MSBUILD_PATH:$PATH;
MSBuild.exe INSTALL.vcxproj //m //nologo //verbosity:normal //p:Configuration=Release //p:Platform=x64;
cd ..;
elif [[ $BUILD == "True" && ( $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ) ]]; then
cd cmake && cmake .. -DCMAKE_BUILD_TYPE=Release && make 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 ./cmake/$FILE_ROOT/*;
elif [[ $BUILD == "True" && ( $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ) ]]; then
tar -zcvf $FILE_NAME -C cmake/$FILE_ROOT .;
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
7z a -tzip $FILE_NAME README.md install.bat LICENSE q examples;
elif [[ $TRAVIS_OS_NAME == "linux" || $TRAVIS_OS_NAME == "osx" ]]; then
tar -zcvf $FILE_NAME README.md install.sh LICENSE q examples;
fi
deploy:
provider: releases
token: "$GITHUB_APIKEY"
file: "$FILE_NAME"
on:
tags: true
condition: $TRAVIS_OS_NAME = windows || $TRAVIS_OS_NAME = osx || ($TRAVIS_DIST = trusty && $TRAVIS_OS_NAME = linux)
skip_cleanup: 'true'