-
Notifications
You must be signed in to change notification settings - Fork 222
/
.travis.yml
56 lines (50 loc) · 3.34 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
language: c
matrix:
include:
- os: linux
compiler: gcc
env: OS_NAME=Linux MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: osx
compiler: clang
env: OS_NAME=Darwin
osx_image: xcode9.2
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update && sudo apt-get install -y g++-7 libdw-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod +x travis_cmake_linux.sh && ./travis_cmake_linux.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod +x travis_cmake_mac.sh && ./travis_cmake_mac.sh; fi
- git submodule update --init --recursive
script:
- export VERSION=`echo "$(git tag -l --points-at HEAD)"`
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export THREAD_COUNT=`echo "$(nproc --all)"`; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export THREAD_COUNT=`echo "$(sysctl -n hw.physicalcpu)"`; fi
- mkdir build && cd build
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DMM_VERSION="$VERSION" -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ..; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DMM_VERSION="$VERSION" ..; fi
- echo "cmake --build . --target marketmaker-mainnet -j $THREAD_COUNT"
- cmake --build . --target marketmaker-mainnet -j $THREAD_COUNT
- cmake --build . --target marketmaker-testnet -j $THREAD_COUNT
# Debug build on Linux, might help to troubleshoot some issues that are hard to reproduce
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../ && mkdir build-debug && cd build-debug; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DMM_VERSION="$VERSION-Debug" -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ..; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake --build . --target marketmaker-mainnet -j $THREAD_COUNT; fi
cache:
apt: true
directories:
- $HOME/.hunter
before_deploy:
- cd ../ && mkdir deploy
- export TAG=`echo "$(git rev-parse --short HEAD)"`
- strip build/iguana/exchanges/marketmaker-mainnet
- strip build/iguana/exchanges/marketmaker-testnet
- tar -cvf deploy/marketmaker-"$TRAVIS_OS_NAME"-"$TAG".tar -C build/iguana/exchanges marketmaker-mainnet marketmaker-testnet
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar --append --file=deploy/marketmaker-"$TRAVIS_OS_NAME"-"$TAG".tar --transform='flags=r;s|net|net-debug|' -C build-debug/iguana/exchanges marketmaker-mainnet; fi
- gzip deploy/marketmaker-"$TRAVIS_OS_NAME"-"$TAG".tar
deploy:
provider: releases
api_key:
secure: "JDwFBGO4WLra9bXr2dsovet8y/ymC0Y+LJNr5/qlUIDt97zVytGbIlUc8BuI2VZFcnAvrtfOGdCs9m/PcLzZd4bMxXSsuaU0AJk/Vj9KzrIIGPJ4uS39KpO1USUpPW+5e0Bisf30JN3N2NypwMbMu42TKjVqaXSbVQfh79Iu6PdnyfiFbbTEfMeiRRrD72c00rwAw7kmndf7Sv9MiMN8WTFe0cQz5eH8GU/BSbnDorSrtClU4r7McR98zXaig/8XVcT543tcqdYW95QO7OqOjAid3XzzA/bPUTjC/nF/AyTJDco26nts0bCrCYeZRXIWdEInFLIeRHhHD7sW7dILRT/I7WlaLWnRtwo8e1L+U1k1yZ84dQMpgBznttdwH3vSj0crwCbFuMaRMMbPeW0H8C1VitLy1mlapw3RDI9yKlcw4V6WjPbz0YKhAoZgT/M/SaGr4ZkoWNCPoV5+Gub78p24Y8Y9BptJgj5t9KAcmDwbJ9wPt006ObWnbXvapo+6N5Dk2zuyQe9seoupzy4CAiNdluzAAVWsV/SjnN2aapjXoxaAaLQC6T8C1l1BpYri9LSKrjerr4QLVl/nw2yovAKNEobLLBVpSwfg4R72fu1BMS65gVsOqtFfs+R47CY+1D1Slev+UmKNMdE51+aXM+1XeC6wDUS5d13mW1NLhOE="
file_glob: true
file: "deploy/*"
on:
tags: true
skip_cleanup: true