forked from crypto-com/thaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (105 loc) · 3.29 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
clean_cache: &clean_cache
language: rust
sudo: required
dist: xenial
if: type = cron
cache:
directories: # cargo caching from https://docs.travis-ci.com/user/caching/#rust-cargo-cache
- $HOME/.cargo
- $TRAVIS_BUILD_DIR/target
- $HOME/.rustup/toolchains
- $HOME/lib
- $HOME/include
- $HOME/bin
- /usr/local/bin # kcov
install:
script:
echo "Cleaning cargo cache ..."
rm -rf $HOME/.cargo/registry
rm -rf $HOME/.rustup/toolchains
cargo clean
rust: &rust
language: rust
sudo: required
dist: xenial
addons:
apt:
packages:
- libssl-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- libc6-dev
- libudev-dev
- protobuf-compiler
cache:
directories:
- $HOME/.cargo
- $HOME/.rustup/toolchains
- $HOME/lib
- $HOME/include
- $HOME/bin
before_cache:
- du -sh $HOME/.cargo $HOME/.rustup/toolchains $HOME/lib $HOME/include $HOME/bin
- rm -rf $HOME/.cargo/registry/src
env:
- RUST_BACKTRACE=1
- RUSTFLAGS="-Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3 -D warnings"
- PATH=$HOME/.local/bin:$PATH:/opt/sgxsdk/bin/x64
- LD_LIBRARY_PATH=$HOME/lib:/opt/sgxsdk/sdk_libs
- PKG_CONFIG_PATH=$HOME/lib/pkgconfig:/opt/sgxsdk/pkgconfig
- SGX_SDK=/opt/sgxsdk
- MRSIGNER=0000000000000000000000000000000000000000000000000000000000000000
- TQE_MRENCLAVE=0000000000000000000000000000000000000000000000000000000000000000
- NETWORK_ID=ab
before_install: # versions from https://github.com/erickt/rust-zmq/blob/master/.travis.yml
- |
if [[ "$TRAVIS_RUST_VERSION" != nightly ]]; then
sed -i.bak -E "s/default = \[\".+\"\]/default = \[\"mock-enclave\"\]/" chain-abci/Cargo.toml;
sed -i.bak -E "s/default = \[\".+\"\]/default = \[\"mock-enclave\", \"sled\", \"websocket-rpc\"\]/" client-common/Cargo.toml;
fi
- |
if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
./ci-scripts/install_kcov.sh
cargo-kcov --version || cargo install cargo-kcov;
fi
script:
- cargo build
- cargo test
- |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
./ci-scripts/check-docker-app-hash.sh || travis_terminate 1
(rustfmt --version || rustup component add rustfmt)
cargo fmt -- --check --color=auto || travis_terminate 1
(cargo-clippy --version || rustup component add clippy)
cargo clippy -- -D warnings || travis_terminate 1
(cargo-audit -h || cargo install cargo-audit)
cargo audit || travis_terminate 1
fi
after_success: |
if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
travis_wait 30 cargo kcov --all;
bash <(curl -s https://codecov.io/bash);
fi
jobs:
allow_failures:
- rust: nightly
include:
- <<: *rust
rust: stable
if: (type != cron) AND (branch != staging.tmp) AND (branch != trying.tmp)
- <<: *rust
rust: beta
if: (type != cron) AND ((branch = staging) OR (branch = trying))
- <<: *rust
rust: nightly
if: (type != cron) AND (branch != staging.tmp) AND (branch != trying.tmp)
- <<: *clean_cache
rust: stable
- <<: *clean_cache
rust: beta
- <<: *clean_cache
rust: nightly