forked from exonum/exonum
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
149 lines (137 loc) · 4.3 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
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:exonum/rocksdb'
- sourceline: 'ppa:maarten-fonville/protobuf'
- sourceline: 'ppa:fsgmhoward/shadowsocks-libev'
- sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/prod xenial main'
key_url: https://packages.microsoft.com/keys/microsoft.asc
packages:
- binutils-dev
- build-essential
- cmake
- g++
- gcc
- libcurl4-openssl-dev
- libdw-dev
- libelf-dev
- libiberty-dev
- libprotobuf-dev
- librocksdb5.17
- libsnappy-dev
- libsodium-dev
- libssl-dev
- pkg-config
- powershell
- protobuf-compiler
- unzip
- zlib1g-dev
rust:
- 1.32.0
cache:
directories:
- node_modules
- $HOME/.cargo
- $HOME/.local
- $TRAVIS_BUILD_DIR/target
- $TRAVIS_BUILD_DIR/testkit/examples/server/node_modules
dist: xenial
sudo: required
env:
global:
- DEADLINKS_VERS=0.3.0
- RUSTFLAGS="-D warnings"
- ROCKSDB_LIB_DIR=/usr/lib
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
matrix:
- FEATURE=test
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
- rustfmt -V
- nvm install 8 && nvm use 8
- npm install
- ./node_modules/.bin/cspell --version
- ./node_modules/.bin/markdownlint --version
script:
- npm run cspell
- npm run md
# Force build.rs execution.
- cargo check -p exonum
- cargo fmt --all -- --check
- 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
# Run kcov.
- name: kcov
install:
- 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
script:
- cargo test --no-run
- cd $TRAVIS_BUILD_DIR
- 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"
# Tests.
- name: test
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
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1
- cd $TRAVIS_BUILD_DIR/testkit/server && npm run proto && npm run test:unix
# Clippy linting.
- name: clippy
install:
- rustup component add clippy
- cargo clippy --version
script:
- cargo clippy --all -- -D warnings
# Benchmarks (compilation only).
- name: benchmarks
rust: nightly-2018-12-30
script:
- RUST_LOG=off cargo check --benches --features "long_benchmarks"
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/9599da7e3a500810190d