-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5e42e6
commit edb1c0b
Showing
6 changed files
with
154 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,98 @@ | ||
matrix: | ||
include: | ||
- dist: xenial | ||
os: linux | ||
- dist: trusty | ||
os: linux | ||
- dist: bionic | ||
os: linux | ||
- os: osx | ||
- os: windows | ||
language: c | ||
sudo: required | ||
dist: trusty | ||
compiler: gcc | ||
|
||
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 | ||
|
||
stages: | ||
- build Release | ||
- 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; | ||
|
||
jobs: | ||
include: | ||
# 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 | ||
|
||
# LINUX BUILD | ||
- stage: build Release | ||
if: branch != coverity_scan | ||
name: "Linux Build Release" | ||
os: linux | ||
before_install: | ||
- mkdir paho.mqtt.c | ||
- wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/Eclipse-Paho-MQTT-C-1.3.2-Linux.tar.gz | ||
- tar xvf Eclipse-Paho-MQTT-C-1.3.2-Linux.tar.gz -C ./paho.mqtt.c --strip-components=1 | ||
- export PAHO_HOME=$TRAVIS_BUILD_DIR/paho.mqtt.c | ||
install: | ||
- mkdir cmake && cd cmake && cmake .. | ||
script: | ||
- make install VERBOSE=1 | ||
before_deploy: | ||
- tar -zcvf mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.tar.gz mqtt | ||
deploy: | ||
provider: releases | ||
api_key: "$GITHUB_APIKEY" | ||
file: mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.tar.gz | ||
on: | ||
tags: true | ||
skip_cleanup: 'true' | ||
# 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 | ||
|
||
# OSX BUILD | ||
- stage: build Release | ||
if: branch != coverity_scan | ||
name: "MacOS Build Release" | ||
os: osx | ||
before_install: | ||
- mkdir paho.mqtt.c | ||
- wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/Eclipse-Paho-MQTT-C-1.3.2-Darwin.tar.gz | ||
- tar xvf Eclipse-Paho-MQTT-C-1.3.2-Darwin.tar.gz -C ./paho.mqtt.c --strip-components=1 | ||
- export PAHO_HOME=$TRAVIS_BUILD_DIR/paho.mqtt.c | ||
install: | ||
- mkdir cmake && cd cmake && cmake .. | ||
script: | ||
- make install VERBOSE=1 | ||
before_deploy: | ||
- tar -zcvf mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.tar.gz mqtt | ||
deploy: | ||
provider: releases | ||
api_key: "$GITHUB_APIKEY" | ||
file: mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.tar.gz | ||
on: | ||
tags: true | ||
skip_cleanup: 'true' | ||
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 | ||
|
||
# WINDOWS (VISUAL STUDIO 2017) BUILD | ||
- stage: build Release | ||
if: branch != coverity_scan | ||
name: "Windows MVS 2017 Build Release" | ||
os: windows | ||
before_install: | ||
- mkdir paho.mqtt.c | ||
- wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/eclipse-paho-mqtt-c-win64-1.3.2.zip | ||
- 7z x -opaho.mqtt.c eclipse-paho-mqtt-c-win64-1.3.2.zip | ||
- export PAHO_HOME=$TRAVIS_BUILD_DIR/paho.mqtt.c | ||
install: | ||
- mkdir cmake && cd cmake && cmake -G "Visual Studio 15 2017 Win64" .. | ||
script: | ||
- export MSBUILD_PATH="/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/" | ||
- export PATH=$PATH:$MSBUILD_PATH | ||
- MSBuild.exe INSTALL.vcxproj //m //nologo //verbosity:normal //p:Configuration=Release //p:Platform=x64 | ||
before_deploy: | ||
- 7z a -r mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.zip mqtt/* | ||
deploy: | ||
provider: releases | ||
api_key: "$GITHUB_APIKEY" | ||
file: mqtt-${TRAVIS_OS_NAME}-${TRAVIS_TAG}.zip | ||
on: | ||
tags: true | ||
skip_cleanup: 'true' | ||
|
||
deploy: | ||
provider: releases | ||
api_key: "$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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
mkdir cbuild | ||
|
||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/Eclipse-Paho-MQTT-C-1.3.2-Darwin.tar.gz | ||
tar xvf Eclipse-Paho-MQTT-C-1.3.2-Darwin.tar.gz -C ./cbuild --strip-components=1 | ||
elif [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/Eclipse-Paho-MQTT-C-1.3.2-Linux.tar.gz | ||
tar xvf Eclipse-Paho-MQTT-C-1.3.2-Linux.tar.gz -C ./cbuild --strip-components=1 | ||
elif [ "$TRAVIS_OS_NAME" == "windows" ]; then | ||
wget https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.2/eclipse-paho-mqtt-c-win64-1.3.2.zip | ||
7z x -ocbuild eclipse-paho-mqtt-c-win64-1.3.2.zip | ||
else | ||
echo "$TRAVIS_OS_NAME is currently not supported" | ||
fi |