@@ -15,14 +15,6 @@ executors:
1515 resource_class : small
1616
1717commands :
18- rust_setup :
19- description : Set rustc version
20- steps :
21- - run :
22- name : Set rustc version
23- command : |
24- rustup default stable
25- rustup update stable
2618 print_versions :
2719 description : Version Info
2820 steps :
@@ -32,6 +24,10 @@ commands:
3224 env_setup :
3325 description : Environment Setup
3426 steps :
27+ - run :
28+ name : Set RUST_NIGHTLY
29+ command : |
30+ echo 'export RUST_NIGHTLY=nightly-2020-03-18' >> $BASH_ENV
3531 - run :
3632 name : Setup Env
3733 command : |
@@ -40,6 +36,7 @@ commands:
4036 echo 'export LIBRA_DUMP_LOGS=1' >> $BASH_ENV
4137 echo 'export CARGO_INCREMENTAL=0' >> $BASH_ENV
4238 echo 'export CI_TIMEOUT="timeout 40m"' >> $BASH_ENV
39+ echo 'export CARGO="$(rustup which --toolchain $RUST_NIGHTLY cargo) -Z features=all"' >> $BASH_ENV
4340 install_deps :
4441 steps :
4542 - run :
@@ -48,14 +45,15 @@ commands:
4845 sudo apt-get update
4946 sudo apt-get install -y cmake curl clang llvm
5047 rustup component add clippy rustfmt
48+ rustup toolchain install nightly
5149 install_code_coverage_deps :
5250 steps :
5351 - run :
5452 name : Install grcov and lcov
5553 command : |
5654 sudo apt-get update
5755 sudo apt-get install lcov
58- cargo install --force grcov
56+ $(CARGO) install --force grcov
5957 install_docker_linter :
6058 steps :
6159 - run :
@@ -64,11 +62,6 @@ commands:
6462 export HADOLINT=${HOME}/hadolint
6563 export HADOLINT_VER=v1.17.4
6664 curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VER}/hadolint-$(uname -s)-$(uname -m)" && chmod 700 ${HADOLINT}
67- install_rust_nightly_toolchain :
68- steps :
69- - run :
70- name : Install nightly toolchain for features not in beta/stable
71- command : rustup install nightly
7265 find_dockerfile_changes :
7366 steps :
7467 - run :
@@ -82,7 +75,6 @@ commands:
8275 build_setup :
8376 steps :
8477 - checkout
85- - rust_setup
8678 - print_versions
8779 - env_setup
8880 - install_deps
@@ -104,37 +96,37 @@ jobs:
10496 - run :
10597 name : Linting
10698 command : |
107- [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || cargo x lint
108- [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || cargo xclippy --workspace --all-targets
109- [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || cargo xfmt --check
110- [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || cargo install cargo-guppy --git http://github.com/calibra/cargo-guppy --rev 8b2bc45c0cd6323a7a2b8170ddad6d2a5b79047b
111- [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || [[ -z $(cargo guppy dups --target x86_64-unknown-linux-gnu --kind directthirdparty) ]]
99+ [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || $CARGO x lint
100+ [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || $CARGO xclippy --workspace --all-targets
101+ [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || $CARGO xfmt --check
102+ [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || $CARGO install cargo-guppy --git http://github.com/calibra/cargo-guppy --rev 8b2bc45c0cd6323a7a2b8170ddad6d2a5b79047b
103+ [[ $CIRCLE_NODE_INDEX =~ [1234] ]] || [[ -z $($CARGO guppy dups --target x86_64-unknown-linux-gnu --kind directthirdparty) ]]
112104 - run :
113105 name : Build Release
114106 command : |
115- [[ $CIRCLE_NODE_INDEX =~ [0234] ]] || RUST_BACKTRACE=1 cargo build -j 16 --release
107+ [[ $CIRCLE_NODE_INDEX =~ [0234] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 --release
116108 - run :
117109 name : Build Dev
118110 command : |
119- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16
120- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p libra-swarm
121- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p cluster-test
122- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p libra-fuzzer
123- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p language_benchmarks
124- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p cost-synthesis
125- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 cargo build -j 16 -p test-generation
111+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16
112+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p libra-swarm
113+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p cluster-test
114+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p libra-fuzzer
115+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p language_benchmarks
116+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p cost-synthesis
117+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CARGO build -j 16 -p test-generation
126118 - run :
127119 name : Run All Non Flaky Unit Tests
128120 command : |
129- [[ $CIRCLE_NODE_INDEX =~ [0134] ]] || RUST_BACKTRACE=1 $CI_TIMEOUT cargo test --all-features --workspace --exclude libra-node --exclude libra-crypto --exclude testsuite --exclude consensus
121+ [[ $CIRCLE_NODE_INDEX =~ [0134] ]] || RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO test --all-features --workspace --exclude libra-node --exclude libra-crypto --exclude testsuite --exclude consensus
130122 - run :
131123 name : Run Cryptography Unit Tests with the formally verified backend
132124 command : |
133- [[ $CIRCLE_NODE_INDEX =~ [0134] ]] || ( RUST_BACKTRACE=1 cd crypto/crypto && $CI_TIMEOUT cargo test --features='std fiat_u64_backend fuzzing' --no-default-features )
125+ [[ $CIRCLE_NODE_INDEX =~ [0134] ]] || ( RUST_BACKTRACE=1 cd crypto/crypto && $CI_TIMEOUT $CARGO test --features='std fiat_u64_backend fuzzing' --no-default-features )
134126 - run :
135127 name : Run All End to End Tests
136128 command : |
137- [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CI_TIMEOUT cargo x test --package testsuite -- --test-threads 1
129+ [[ $CIRCLE_NODE_INDEX =~ [0124] ]] || RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO x test --package testsuite -- --test-threads 1
138130 - run :
139131 name : Run Quarantined Unit Tests 3 (consensus) times
140132 command : |
@@ -155,16 +147,16 @@ jobs:
155147 steps :
156148 - build_setup
157149 - run :
158- name : Install Cargo Audit
150+ name : Install cargo-audit
159151 command : |
160- cargo install --force cargo-audit
152+ $CARGO install --force cargo-audit
161153 - run :
162154 # NOTE ignored advisory rules
163155 # RUSTSEC-2018-0015 - term
164156 # RUSTSEC-2019-0031 - spin
165157 name : Audit crates
166158 command : |
167- cargo audit --deny-warnings \
159+ $CARGO audit --deny-warnings \
168160 --ignore RUSTSEC-2018-0015 \
169161 --ignore RUSTSEC-2019-0031
170162 - build_teardown
@@ -174,7 +166,6 @@ jobs:
174166 steps :
175167 - build_setup
176168 - install_code_coverage_deps
177- - install_rust_nightly_toolchain
178169 - run :
179170 name : Setup code coverage output
180171 command : echo "export CODECOV_OUTPUT=codecov" >> $BASH_ENV
0 commit comments