-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
111 lines (103 loc) · 3.04 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
101
102
103
104
105
106
107
108
109
110
111
jobs:
include:
- dist: xenial
os: linux
- dist: bionic
os: linux
- os: osx
- os: windows
os: linux
dist: xenial
language: c
compiler: gcc
before_install:
# Set global flags
- export FILE_ROOT=ffikdb
- export TESTS="True"
# Install dependencies
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
sudo apt-get install -y libffi-dev;
export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH};
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
echo "Utilize system ffi for Mac OSX.";
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
./travis_setup.sh;
export DL_INSTALL_DIR=$(pwd)/cbuild/install;
export LD_LIBRARY_PATH=${DL_INSTALL_DIR}/lib:${LD_LIBRARY_PATH};
export FFI_INSTALL_DIR=$(pwd)/travis_win/libffi/install;
export LD_LIBRARY_PATH=${FFI_INSTALL_DIR}/bin:${LD_LIBRARY_PATH};
export PATH=${DL_INSTALL_DIR}/lib:${PATH};
export PATH=${DL_INSTALL_DIR}/bin:${PATH};
export PATH=${FFI_INSTALL_DIR}/lib:${PATH};
export PATH=${FFI_INSTALL_DIR}/bin:${PATH};
else
echo "Unsupported OS.";
exit 1;
fi
# Set OS directory and license location
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
QLIBDIR=l64;
QLIC_KC=$L64;
elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
QLIBDIR=w64;
QLIC_KC=$W64;
else
QLIBDIR=m64;
QLIC_KC=$M64;
fi
- export QLIBDIR
- export QLIC_KC
# Set QHOME
- mkdir -p qhome/${QLIBDIR}
- export QHOME=$(pwd)/qhome
- export PATH=${PATH}:${QHOME}/${QLIBDIR}
# Prepare Test
- if [[ $TESTS == True && "x$OD" != "x" && "x$QLIC_KC" != "x" ]]; then
curl -o ${QHOME}/q.zip -L $OD;
unzip -d ${QHOME} ${QHOME}/q.zip;
echo -n $QLIC_KC | base64 --decode > ${QHOME}/kc.lic;
else
echo "No kdb+, no tests";
fi
# Set Release Package
- 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}
# Build
- mkdir build && cd build
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
cmake -G "Visual Studio 15 2017 Win64" --config Release ..;
cmake --build . --config Release --target install;
cd ../;
else
cmake ..;
cmake --build . --config Release --target install;
cd ../;
fi
script:
# Test
- if [[ $TESTS == "True" && "x$OD" != "x" && "x$QLIC_KC" != "x" ]]; then
curl -fsSL -o test.q https://github.com/KxSystems/hdf5/raw/master/test.q;
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
q test.q tests_win/ -q;
else
q test.q tests/ -q;
fi
fi
# Build Package
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
7z a -tzip -r ${FILE_NAME} build/${FILE_ROOT};
else
tar -czf ${FILE_NAME} build/${FILE_ROOT};
fi
deploy:
provider: releases
token: ${GITHUB_APIKEY}
file: ${FILE_NAME}
on:
tags: true
condition: $TRAVIS_OS_NAME == "windows" || $TRAVIS_OS_NAME == "osx" || ($TRAVIS_OS_NAME == "linux" && $TRAVIS_DIST == "xenial")
skip_cleanup: true