Skip to content

Commit 02f62e6

Browse files
committed
Optimize CI by replacing data generation with download to speed up processing.
1 parent 0886da1 commit 02f62e6

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

dev_support/test.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,26 @@ set -e
1111
echoStep "Clean"
1212
cargo clean
1313

14-
echoStep "Check fmt"
15-
./cargo_fmt.sh -- --check
14+
echoStep "Download AMT parameters"
15+
wget -P pp/ https://conflux-rust-dev.s3.ap-east-1.amazonaws.com/amt-params/amt-prove-mont-nxssWC-16-16.bin &
1616

17-
export RUSTFLAGS="-D warnings"
17+
( # Start of the block that should run concurrently with the download
18+
echoStep "Check fmt"
19+
./cargo_fmt.sh -- --check
1820

19-
echoStep "Check all"
20-
cargo check --all
21+
export RUSTFLAGS="-D warnings"
2122

22-
echoStep "Check all tests"
23-
cargo check --all --tests --benches
23+
echoStep "Check all"
24+
cargo check --all
2425

25-
echoStep "Check clippy"
26-
cargo clippy --all-targets --all-features -- -D warnings
26+
echoStep "Check all tests"
27+
cargo check --all --tests --benches
2728

29+
echoStep "Check clippy"
30+
cargo clippy --all-targets --all-features -- -D warnings
31+
) & # End of the block, run this block in the background
32+
33+
# Wait for both the download and the block of cargo operations to finish
34+
wait
2835
echoStep "Test"
2936
cargo test -r --all

src/lvmt/tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ use super::{crypto::PE, example::LvmtStorage, storage::LvmtStore};
1717

1818
pub const TEST_LEVEL: usize = 16;
1919

20-
pub static AMT: Lazy<AmtParams<PE>> =
21-
Lazy::new(|| AmtParams::from_dir_mont("./pp", TEST_LEVEL, TEST_LEVEL, CreateMode::Both, None));
20+
pub static AMT: Lazy<AmtParams<PE>> = Lazy::new(|| {
21+
AmtParams::from_dir_mont("./pp", TEST_LEVEL, TEST_LEVEL, CreateMode::Neither, None)
22+
});
2223

2324
fn u64_to_boxed_u8(value: u64) -> Box<[u8]> {
2425
let byte_array: [u8; 8] = value.to_ne_bytes();

0 commit comments

Comments
 (0)