forked from exonum/exonum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
196 lines (181 loc) · 6.26 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
186
187
188
189
190
191
192
193
194
195
196
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$/
# Branch names endings with "-dev" (for example "update-rust-dev").
- /-dev$/
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.8
- libsnappy-dev
- libsodium-dev
- libssl-dev
- pkg-config
- powershell
- protobuf-compiler
- python3-venv
- unzip
- zlib1g-dev
rust:
- 1.46.0
cache:
npm: true
directories:
- $HOME/.cache
- $HOME/.cargo
- $HOME/.local
- $HOME/.kcov
dist: bionic
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.13
matrix:
- FEATURE=test
before_install:
- sccache -V | grep $SCCACHE_VERS || cargo install sccache --vers $SCCACHE_VERS
- 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
- 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-targets --all-features
# 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 --all-targets --no-run
- |
for file in `find target/debug/ -maxdepth 2 -path target/debug/deps -prune -o -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-targets
# Doc tests.
- name: doc-test
script:
- cargo test --workspace --doc
# Run examples and soak tests.
- name: examples
script:
- cargo run -p exonum-merkledb --example manual_migration
- cargo run -p exonum-merkledb --example migration_with_helper
- cargo run -p exonum-merkledb --example migration_with_iter_loop
- cargo run -p exonum-merkledb --example blockchain
- cargo run -p exonum-sample-runtime
- cargo run -p exonum-explorer --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
- cargo run -p exonum-soak-tests --bin toggle -- -H 10
- cargo run -p exonum-soak-tests --bin send_txs -- -T 100
- cargo run -p exonum-soak-tests --bin sleepy -- -H 10
- cargo run -p exonum-soak-tests --bin tx_filtering -- -H 10
- cargo run -p exonum-keys --example key-generator -- -p passphrase -s a7839ea524f38d0e91a5ec96a723092719dc8a5b8a75f9131d9eb38f45e76344
# 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 10 && nvm use 10
- cd $TRAVIS_BUILD_DIR/test-suite/testkit/server && npm install && cd $TRAVIS_BUILD_DIR
- cargo build -p exonum-testkit-server
- cargo install --path $TRAVIS_BUILD_DIR/examples/cryptocurrency-advanced/backend
- cargo install --path $TRAVIS_BUILD_DIR/examples/cryptocurrency-advanced/backend --example cryptocurrency-migration
- cargo build -p exonum-cryptocurrency --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/test-suite/testkit/server && npm run test:unix
- cd $TRAVIS_BUILD_DIR
after_script:
- deactivate
- rm -rf .venv
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/9599da7e3a500810190d