forked from exonum/exonum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
184 lines (169 loc) · 5.63 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
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:maarten-fonville/protobuf'
- sourceline: 'ppa:fsgmhoward/shadowsocks-libev'
- sourceline: 'ppa:exonum/rocksdb'
- sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic 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
- librocksdb6.2
- libsnappy-dev
- libsodium-dev
- libssl-dev
- pkg-config
- powershell
- protobuf-compiler
- python3-venv
- unzip
- zlib1g-dev
rust:
- 1.38.0
cache:
npm: true
directories:
- $HOME/.cache
- $HOME/.cargo
- $HOME/.local
- $HOME/.kcov
dist: bionic
sudo: required
env:
global:
- DEADLINKS_VERS=0.4.1
- RUSTFLAGS="-D warnings"
- ROCKSDB_LIB_DIR=/usr/lib
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
- SCCACHE_VERS=0.2.12
matrix:
- FEATURE=test
before_install:
- sccache -V | grep $SCCACHE_VERS || cargo install sccache --vers $SCCACHE_VERS --force
- export RUSTC_WRAPPER=sccache
jobs:
allow_failures:
- name: integration-tests
include:
# Formatting & other lints.
- 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
- rustup component add clippy
- cargo clippy --version
- 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
# Clippy lints.
- cargo clippy --all --tests --examples --benches --features "long_benchmarks"
# Other cargo lints.
- 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_configuration
- mkdir -p target/std/string
- touch target/std/string/struct.String.html
- touch target/std/primitive.usize.html
- mkdir -p target/doc/std/option
- touch target/doc/exonum_cli/password/struct.String.html
- touch target/doc/std/option/enum.Option.html
- touch target/doc/std/primitive.usize.html
- touch target/doc/std/primitive.char.html
- cargo deadlinks --dir target/doc
# Run kcov.
- name: kcov
install:
- |
if [ ! -f "$HOME/.kcov/bin/kcov" ]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
cd kcov-master
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.kcov -DCMAKE_BUILD_TYPE=Release
make -j2
make install
cd ../..
rm -rf kcov-master
fi
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)"; $HOME/.kcov/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"
# Unit tests (including test runs for benchmarks).
- name: unit-test
script:
- cargo test --all --lib --tests --benches
- cargo test --all --doc
# Run examples.
- name: examples
script:
- cargo run -p exonum-merkledb --example migration
- cargo run -p exonum-merkledb --example blockchain
- cargo run -p exonum-sample-runtime
- cargo run -p exonum-node-tests --example explorer
- cargo run -p exonum-testkit --example timestamping
- cargo run -p exonum-supervisor --example configuration_change
- cargo run -p exonum-time --example simple_service
# Integration tests.
- name: integration-tests
install:
- python3 -m venv .venv
- source .venv/bin/activate
- pip3 install pip --upgrade
# Clone exonum-launcher to get a current master instead of release version.
- git clone https://github.com/exonum/exonum-launcher.git .venv/exonum-launcher
# Install dependencies from github-provided exonum-launcher (so we can get latest changes without release).
- pip3 install -r .venv/exonum-launcher/requirements.txt
# Install exonum-launcher itself from the cloned repo as well.
- pip3 install -e .venv/exonum-launcher
# Install integration tests.
- pip3 install -e $TRAVIS_BUILD_DIR/test-suite/exonum-py-tests --no-binary=protobuf protobuf
- nvm install 8 && nvm use 8
- cd $TRAVIS_BUILD_DIR/test-suite/testkit/server && npm install && cd $TRAVIS_BUILD_DIR
- cargo install --path $TRAVIS_BUILD_DIR/examples/cryptocurrency-advanced/backend --force
- cargo build --manifest-path $TRAVIS_BUILD_DIR/examples/cryptocurrency/Cargo.toml --example demo
script:
- python3 -m exonum_tests -v
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1
- cd $TRAVIS_BUILD_DIR
after_script:
- deactivate
- rm -rf .venv
# Check compatibility with Rust 1.36.
- name: 1.36-compat
rust: 1.36.0
script:
- cargo check --all --benches --tests --bins --examples --features "long_benchmarks"
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/9599da7e3a500810190d