-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
199 lines (190 loc) · 6.38 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
197
198
199
language: rust
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
rust:
- stable
- beta
- nightly
os:
- linux
- osx
- windows
jobs:
include:
- name: Hash Tests 1
env: TEST_HASHES_SEC_1='true'
- name: Hash Tests 2
env: TEST_HASHES_SEC_2='true'
- name: SerializationTests
env: TEST_SERIALIZE='true'
- name: StructureTests
env: TEST_BACKEND='true'
- name: Audit
env: AUDIT='true'
allow_failures:
- rust: nightly
fast_finish: true
env:
- RUSTFLAGS='-C link-dead-code'
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update
fi
- |
if [[ "$AUDIT" == "true" ]]; then
cargo install --force cargo-audit
fi
- export NUM_TEST_THREADS=8
dist: bionic
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- zlib1g-dev
- libiberty-dev
# Add clippy
before_script:
- |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
( ( cargo install clippy && export CLIPPY=true ) || export CLIPPY=false );
fi
- export PATH=$PATH:~/.cargo/bin
script:
- cargo build --verbose --all
- |
if [[ "$AUDIT" == "true" ]]; then
( cargo audit );
fi
- cargo test --verbose --all -- --test-threads $NUM_TEST_THREADS
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="bincode" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="json" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="cbor" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="yaml" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="pickle" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_SERIALIZE" == "true" ]]; then
( cargo test --features="ron" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="blake2b" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="groestl" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="sha2" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="sha3" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="keccak" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="seahash" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="fx" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_1" == "true" ]]; then
( cargo test --features="blake2b_rfc" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="md2" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="md4" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="md5" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="ripemd160" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="sha1" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="rust_sha2" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="rust_sha3" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="rust_keccak" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_HASHES_SEC_2" == "true" ]]; then
( cargo test --features="whirlpool" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_BACKEND" == "true" ]]; then
( cargo test --features="hashbrown" --verbose --all -- --test-threads $NUM_TEST_THREADS );
fi
- |
if [[ "$TEST_BACKEND" == "true" ]]; then
( cargo test --features="rocksdb bincode fx" --verbose --all -- --test-threads 1 );
fi
- |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" && $CLIPPY ]]; then
cargo clippy
fi
after_success:
# Coverage report
- |
if [[ "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
for crate in starling; do for file in target/debug/$crate-*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done; done &&
for crate in merkle_bit; do for file in target/debug/$crate-*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
fi