forked from exonum/exonum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
185 lines (171 loc) · 6.11 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
language: rust
branches:
only:
- master
# Github release tags (for example "v0.9" or "v0.9.1").
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
# Branch names endings with "-release" (for example "0.9.0-release").
- /-release$/
addons:
apt:
sources:
- sourceline: 'ppa:giskou/librocksdb'
packages:
- gcc
- g++
- libssl-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- libiberty-dev
- libsnappy-dev
- librocksdb
- cmake
- zlib1g-dev
- build-essential
- pkg-config
- unzip
rust:
- 1.30.0
cache:
directories:
- node_modules
- $HOME/.cargo
- $HOME/.local
- $TRAVIS_BUILD_DIR/target
- $TRAVIS_BUILD_DIR/testkit/examples/server/node_modules
dist: trusty
sudo: required
env:
global:
- DEADLINKS_VERS=0.3.0
- SODIUM_VERS=1.0.13
- CARGO_INCREMENTAL=1
- RUSTFLAGS="-D warnings"
- ROCKSDB_LIB_DIR=/usr/lib/x86_64-linux-gnu
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
matrix:
- FEATURE=test
# Separate jobs should use `install` hook in order not to override these common
# instructions.
before_install:
- |
if [ ! -f "$HOME/.local/lib/libsodium.a" ]; then
wget "https://github.com/jedisct1/libsodium/releases/download/$SODIUM_VERS/libsodium-$SODIUM_VERS.tar.gz" -t 5 -O "libsodium.tar.gz"
tar xvf libsodium.tar.gz
cd libsodium-$SODIUM_VERS
./configure --prefix=$HOME/.local
make
make install
cd ..
fi
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig
jobs:
include:
# Formatting & other lints that do not require compilation.
- name: lints
install:
- cargo deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
- cargo install --list
- rustup component add rustfmt-preview
- rustfmt -V
- nvm install 8 && nvm use 8
- npm install
- ./node_modules/.bin/cspell --version
- ./node_modules/.bin/markdownlint --version
script:
- cargo fmt --all -- --check
- npm run cspell
- npm run md
- cargo clean --doc
- cargo doc --no-deps
# TODO: Temporary hack to ignore warnings about missing pages. (ECR-703)
- mkdir -p target/doc/exonum/encoding/serialize/reexport/serde
- mkdir -p target/doc/exonum/encoding/serialize/reexport/de/serde
- mkdir -p target/doc/exonum_configuration
- mkdir -p target/std/string
- touch target/doc/exonum/encoding/serialize/trait.Serialize.html
- touch target/doc/exonum/encoding/serialize/reexport/serde/index.html
- touch target/doc/exonum/encoding/serialize/reexport/de/serde/index.html
- touch target/doc/exonum_configuration/enum.Option.html
- touch target/std/string/struct.String.html
- touch target/std/primitive.usize.html
- cargo deadlinks --dir target/doc
# Clippy linting.
- name: clippy
rust: nightly-2018-10-23
install:
- cargo clippy --version | rustup component add clippy-preview --toolchain=nightly-2018-10-23
- cargo clippy --version
script:
- cargo clippy --all -- -D warnings
# Tests.
- name: test
addons:
apt:
sources:
- sourceline: 'ppa:giskou/librocksdb'
- sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main'
key_url: https://packages.microsoft.com/keys/microsoft.asc
packages:
- gcc
- g++
- libssl-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- libiberty-dev
- libsnappy-dev
- librocksdb
- powershell
- cmake
- zlib1g-dev
- build-essential
- pkg-config
install:
- nvm install 8 && nvm use 8
- cd $TRAVIS_BUILD_DIR/testkit/server/src && npm install && cd $TRAVIS_BUILD_DIR
script:
- cargo test --all
- cargo run -p exonum --example explorer
- cargo run -p exonum-testkit --example timestamping
- cargo run -p exonum-testkit --example configuration_change
- cargo run -p exonum-time --example simple_service
# Update frontend integrity tests. [ECR-2481]
# - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
# - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1
# - cd $TRAVIS_BUILD_DIR/testkit/server/src && npm run test:unix
after_success: |
cd $TRAVIS_BUILD_DIR
wget https://github.com/SimonKagstrom/kcov/archive/v36.tar.gz &&
tar xzf v36.tar.gz &&
cd kcov-36 &&
mkdir build &&
cd build &&
cmake .. &&
make &&
make install DESTDIR=../../kcov-build &&
cd ../.. &&
rm -rf kcov-36 &&
for file in `find target/debug/ -maxdepth 1 -type f | egrep "*-([a-zA-Z0-9]{16}$)"`; do mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
# Benchmarks (compilation only).
- name: benchmarks
rust: nightly-2018-10-23
script:
- RUST_LOG=off cargo bench --verbose --manifest-path exonum/Cargo.toml --features long_benchmarks --no-run
# Compatibility check with the older rust version. Should be synced with readme badges.
- name: rust_1_27_2_compatibility
rust: 1.27.2
script:
- cargo build
notifications:
slack:
secure: ufnH5/ilJ/GkfzU28GguFgQzL1Jb7gGGVaBytCi1VW9cvME7wHC/Pf3ZDM9cVv7t8Cq6K423J8pSkT8vErB7GzHLGRJK8EsBkuGxiAJiHJIVNf/a20gjyqtS2wSyoVDDFz1LRtCNvQanSy2psSWyJcWtnAllluwRNHKXZWYFOpU6uqt2XIi1s3vuMyVw177alNyQkUJ6mhnt9ZDGoMXfcwXIvZ1bt3GPwAbuvAiHsShIrtVGJYTbIBDBsFsGgc1313xdz670xa1JrvZpIl0ZF91Z/0rxtQZjYos859ARnP+v5TfMpsOZbhVHtLI81/o/dOu/Dnrv2xo4VgLaHCTPfhO7LE7kGZ1OyEFqzsadL+k97JQnfkyyFRA84FrVNvgn5NStJtNRJu593v0zuI1OpmY5Xcu/XG2X3dpYZJGciKywoI8gFCc18taIqWY8P3uL/KdxX3VLikMkmYX+cXxHwhH/RvNLbfxD+hTepz+sGWBnLg/dFNpy3WdzJrSNKE9OAH3Gy53z32fT7XiGF8+juN3RB7MmoLA+sOKnGnjal+o44Ga7KDxHe9lOjRVWAQFH6lIEVNwpdEp+2zqu2QAyCIbYcyEdxo8oKXMwAOPFeIqFGshAYGSQAYbT9V75J2Hfcpqb+EXhiBluCSjoaacg4Yhsc/tFhqI7B5+tq7Z5KVU=
webhooks:
urls:
- https://webhooks.gitter.im/e/9599da7e3a500810190d