forked from libbitcoin/libbitcoin-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
91 lines (71 loc) · 4.58 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
###############################################################################
# Copyright (c) 2014-2015 libbitcoin developers (see COPYING).
#
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
#
###############################################################################
language:
- cpp
os:
- osx
- linux
compiler:
- clang
- gcc
env:
- LINK=static
- LINK=dynamic
matrix:
exclude:
- os: osx
compiler: gcc
fast_finish:
- true
before_install:
# Set aliases for readability.
- if [[ $CC == gcc ]]; then GCC=true; fi
- if [[ $CC == clang ]]; then CLANG=true; fi
- if [[ $LINK == static ]]; then STATIC=true; fi
- if [[ $LINK == dynamic ]]; then DYNAMIC=true; fi
- if [[ $TRAVIS_OS_NAME == osx ]]; then OSX=true; fi
- if [[ $TRAVIS_OS_NAME == linux ]]; then LINUX=true; fi
# Set package repository.
- if [[ $LINUX ]]; then sudo add-apt-repository -y ppa:boost-latest/ppa; fi
- if [[ $LINUX ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [[ $LINUX && $CLANG ]]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi
# Update the system.
- if [[ $LINUX ]]; then sudo apt-get -qq update; fi
install:
# Install g++ 4.8
- if [[ $LINUX ]]; then sudo apt-get install -qq g++-4.8 --allow-unauthenticated; fi
- if [[ $LINUX ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50; fi
- if [[ $LINUX ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50; fi
- if [[ $LINUX ]]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 50; fi
# Install clang++ 3.4
- if [[ $LINUX && $CLANG ]]; then sudo apt-get install -qq clang-3.4 --allow-unauthenticated; fi
- if [[ $LINUX && $CLANG ]]; then sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.4 50; fi
- if [[ $LINUX && $CLANG ]]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.4 50; fi
# Download and install packages for osx/clang/dynamic.
- if [[ $OSX && $CLANG && $DYNAMIC ]]; then brew unlink boost; brew install boost; fi
# Download and install packages for linux/clang/dynamic.
- if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo apt-get -qq install boost1.54; fi
script:
# Download and build libbitcoin and all dependencies.
- if [[ $OSX && $CLANG && $STATIC ]]; then ./install.sh --with-icu --build-icu --build-boost --enable-testnet --disable-shared --prefix=$TRAVIS_BUILD_DIR/my-prefix; fi
- if [[ $LINUX && $CLANG && $STATIC ]]; then ./install.sh --with-icu --build-icu --build-boost --disable-shared --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then ./install.sh --with-icu --build-icu --build-boost --disable-shared --build-dir=my-build --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-O0 -g -static --coverage' CXXFLAGS='-O0 -g -static --coverage'; fi
- if [[ $OSX && $CLANG && $DYNAMIC ]]; then ./install.sh ; fi
- if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --with-icu --build-icu --disable-ndebug --disable-static CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi
- if [[ $LINUX && $GCC && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --build-boost; fi
after_success:
# Install coveralls and current lcov.
- if [[ $LINUX && $GCC && $STATIC ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then tar xf lcov_1.11.orig.tar.gz; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then sudo make -C lcov-1.11 install; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then gem install coveralls-lcov; fi
# Capture coverage info, filter out system and test code, and debug before upload.
- if [[ $LINUX && $GCC && $STATIC ]]; then lcov --directory . --capture --output-file coverage.info; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then lcov --remove coverage.info "/usr/*" "$TRAVIS_BUILD_DIR/my-prefix/*" "my-build/*" "examples/*" "test/*" --output-file coverage.info; fi
- if [[ $LINUX && $GCC && $STATIC ]]; then lcov --list coverage.info; fi
# Upload coverage info to coveralls service (--repo-token <private coveralls repo token>).
- if [[ $LINUX && $GCC && $STATIC ]]; then coveralls-lcov coverage.info; fi