forked from EOSIO/eos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
87 lines (85 loc) · 3.81 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
language: cpp
compiler: clang
services: mongodb
matrix:
include:
- os: linux
dist: trusty
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- llvm-4.0-dev
- clang-4.0
- g++-6
- ninja-build
- libgmp-dev
- libclang-4.0-dev
- python3
- os: osx
osx_image: xcode9.1
before_install:
- |
mkdir ext && cd ext
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install boost openssl llvm@4 gmp gettext ninja mongodb mongo-c-driver
brew link gettext --force
brew services start mongodb
WASM_BRANCH=macos
export CC=/usr/local/opt/llvm@4/bin/clang
export CXX=/usr/local/opt/llvm@4/bin/clang++
export LLVM_DIR=/usr/local/opt/llvm@4/lib/cmake/llvm
export LDFLAGS="-L/usr/local/opt/llvm@4/lib"
MONGOCXX_CMAKE_OPTIONS="-DLIBBSON_DIR=/usr/local -DLIBMONGOC_DIR=/usr/local"
EOS_CMAKE_OPTIONS="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
else
WASM_BRANCH=master
CMAKE_DIR=$TRAVIS_BUILD_DIR/ext/cmake-3.9.0-Linux-x86_64/bin/
export CC=clang-4.0
export CXX=clang++-4.0
export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/ext/lib
MONGOCXX_CMAKE_OPTIONS="-DLIBBSON_DIR=$TRAVIS_BUILD_DIR/ext -DLIBMONGOC_DIR=$TRAVIS_BUILD_DIR/ext"
EOS_CMAKE_OPTIONS="-DBOOST_ROOT=$TRAVIS_BUILD_DIR/ext"
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2
tar xjf boost_1_64_0.tar.bz2
cd boost_1_64_0
./bootstrap.sh --prefix=$TRAVIS_BUILD_DIR/ext
echo 'using clang : 4.0 : clang++-4.0 ;' >> project-config.jam
./b2 -d0 -j4 --with-thread --with-date_time --with-system --with-filesystem --with-program_options --with-signals --with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine toolset=clang link=static install
cd $TRAVIS_BUILD_DIR/ext
wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.tar.gz
tar xzf cmake-3.9.0-Linux-x86_64.tar.gz
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.8.0/mongo-c-driver-1.8.0.tar.gz
tar xzf mongo-c-driver-1.8.0.tar.gz
cd mongo-c-driver-1.8.0
./configure --disable-automatic-init-and-cleanup --prefix=$TRAVIS_BUILD_DIR/ext
make install
fi
cd $TRAVIS_BUILD_DIR/ext
git clone --depth 1 -b $WASM_BRANCH git://github.com/oci-labs/clang-WebAssembly wasm-compiler
git clone --depth 1 git://github.com/cryptonomex/secp256k1-zkp
cd secp256k1-zkp
./autogen.sh
./configure --prefix=$TRAVIS_BUILD_DIR/ext
make install
cd $TRAVIS_BUILD_DIR/ext
git clone --depth 1 -b releases/stable git://github.com/mongodb/mongo-cxx-driver
cd mongo-cxx-driver/build
${CMAKE_DIR}cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/ext $MONGOCXX_CMAKE_OPTIONS ..
ninja install
cd $TRAVIS_BUILD_DIR
script:
- mkdir build && cd build
- ${CMAKE_DIR}cmake -G Ninja -DWASM_LLVM_CONFIG=$TRAVIS_BUILD_DIR/ext/wasm-compiler/bin/llvm-config -DSecp256k1_ROOT_DIR=$TRAVIS_BUILD_DIR/ext -DBINARYEN_ROOT=$TRAVIS_BUILD_DIR/ext/wasm-compiler -DCMAKE_PREFIX_PATH=$TRAVIS_BUILD_DIR/ext -DCMAKE_BUILD_TYPE=Release $EOS_CMAKE_OPTIONS ..
- ninja -j4
- tests/eosd_run_test.sh --host=localhost --port=8888
- '[ "$TRAVIS_OS_NAME" == "osx" ] || EOSLIB=../contracts tests/chain_test'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/slow_test'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/api_test'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/p2p_tests/sync/test.sh'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/p2p_tests/sync/test.sh -p 2 -d 10'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/run_tests.sh'
- '[ "$TRAVIS_OS_NAME" == "osx" ] || tests/eosd_run_mongodb_test.sh'