-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add support for testing different proof types
- Loading branch information
1 parent
81350f9
commit 7908631
Showing
3 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Any error will result in failure | ||
set -e | ||
|
||
TOOLCHAIN_RISC0=+nightly-2024-04-18 | ||
TOOLCHAIN_SP1=+nightly-2024-04-18 | ||
TOOLCHAIN_SGX=+nightly-2024-04-18 | ||
export PROOF_TYPE="$1" | ||
|
||
check_toolchain() { | ||
local TOOLCHAIN=$1 | ||
|
||
# Remove the plus sign from the toolchain name | ||
TOOLCHAIN=${TOOLCHAIN#+} | ||
|
||
# Function to check if the toolchain is installed | ||
exist() { | ||
rustup toolchain list | grep "$TOOLCHAIN" >/dev/null | ||
} | ||
|
||
# Main script logic | ||
if exist; then | ||
echo "Toolchain $TOOLCHAIN exists" | ||
else | ||
echo "Installing Rust toolchain: $TOOLCHAIN" | ||
rustup install "$TOOLCHAIN" | ||
fi | ||
} | ||
|
||
if [ "$CPU_OPT" = "1" ]; then | ||
export RUSTFLAGS='-C target-cpu=native' | ||
echo "Enable cpu optimization with host RUSTFLAGS" | ||
fi | ||
|
||
# NATIVE | ||
if [ -z "$1" ] || [ "$1" == "native" ]; then | ||
cargo test -F integration run_scenarios_sequentially | ||
fi | ||
|
||
# SGX | ||
if [ "$1" == "sgx" ]; then | ||
check_toolchain $TOOLCHAIN_SGX | ||
cargo ${TOOLCHAIN_SGX} test -F "sgx enable integration" run_scenarios_sequentially | ||
fi | ||
|
||
# RISC0 | ||
if [ "$1" == "risc0" ]; then | ||
check_toolchain $TOOLCHAIN_RISC0 | ||
./script/setup-bonsai.sh | ||
cargo ${TOOLCHAIN_RISC0} test -F "risc0 enable integation" run_scenarios_sequentially | ||
fi | ||
|
||
# SP1 | ||
if [ "$1" == "sp1" ]; then | ||
check_toolchain $TOOLCHAIN_SP1 | ||
cargo ${TOOLCHAIN_SP1} test -F "sp1 enable integration" run_scenarios_sequentially | ||
fi |