forked from status-im/nim-eth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
65 lines (57 loc) · 2.33 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
language: c # or other C/C++ variants
sudo: false
# https://docs.travis-ci.com/user/caching/
#
# Caching the whole nim folder is better than relying on ccache - this way, we
# skip the expensive bootstrap process and linking
cache:
directories:
- nim
- rocksdb
matrix:
include:
- os: linux
sudo: required
before_install:
- export INSTALL_PATH=/usr
- export NPROC=$(nproc)
- os: osx
before_install:
- export INSTALL_PATH=$HOME # included in DYLD_FALLBACK_LIBRARY_PATH
- export NPROC=$(sysctl -n hw.ncpu)
install:
# build nim from our own branch - this to avoid the day-to-day churn and
# regressions of the fast-paced Nim development while maintaining the
# flexibility to apply patches
#
# check version of remote branch
- "export NIMVER=$(git ls-remote https://github.com/status-im/nim.git HEAD | cut -f 1)"
# after building nim, wipe csources to save on cache space
- "{ [ -f nim/$NIMVER/bin/nim ] && [ -f nim/$NIMVER/bin/nimble ] ; } ||
{ rm -rf nim ;
mkdir -p nim ;
git clone --depth=1 https://github.com/status-im/nim.git nim/$NIMVER ;
cd nim/$NIMVER ;
sh build_all.sh ;
rm -rf csources ;
cd ../.. ;
}"
- "export PATH=$PWD/nim/$NIMVER/bin:$PATH"
# build our own rocksdb to test with a fixed version that we think works
- "export ROCKSDBVER=5.14.2"
- "[ -f rocksdb/rocksdb-$ROCKSDBVER/Makefile ] || { rm -rf rocksdb ; mkdir -p rocksdb; cd rocksdb; wget https://github.com/facebook/rocksdb/archive/v$ROCKSDBVER.tar.gz && tar xvf v$ROCKSDBVER.tar.gz; cd ..; }"
- cd rocksdb/rocksdb-$ROCKSDBVER
- "[ -f util/build_version.cc ] || { make util/build_version.cc ; }" # use cached version if possible
- export NO_UPDATE_BUILD_VERSION=1
- make shared_lib -j$NPROC && sudo make install-shared
- cd ../..
# no need to cache, lmdb is small and compile very fast
- "export LMDBVER=0.9.22"
- "wget https://github.com/LMDB/lmdb/archive/LMDB_$LMDBVER.tar.gz && tar xvf LMDB_$LMDBVER.tar.gz;"
- cd lmdb-LMDB_$LMDBVER/libraries/liblmdb && make
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sed -i 's| liblmdb.a||' Makefile && sudo make prefix=/usr install; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo cp liblmdb.so /usr/local/lib/liblmdb.dylib; fi
- cd ../../..
script:
- nimble install -y
- nimble test