@@ -17,6 +17,19 @@ if [ $MATCHES -eq 0 ]; then
1717 exit 1
1818fi
1919
20+ # assume role to allow tests to run
21+ mwinit -f
22+ unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_PROFILE
23+ _assume_role=" arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2"
24+ _session_name=" ${USER} -DDBEC-Dafny-Java-Tests"
25+ export AWS_PROFILE=aws-crypto-tools-team+optools-ci-ToolsDevelopment
26+ export AWS_REGION=us-west-2
27+ STS_RESPONSE=` aws sts assume-role --role-arn $_assume_role --role-session-name $_session_name `
28+ export AWS_ACCESS_KEY_ID=` echo " $STS_RESPONSE " | jq -r .Credentials.AccessKeyId`
29+ export AWS_SECRET_ACCESS_KEY=` echo " $STS_RESPONSE " | jq -r .Credentials.SecretAccessKey`
30+ export AWS_SESSION_TOKEN=` echo " $STS_RESPONSE " | jq -r .Credentials.SessionToken`
31+ unset AWS_PROFILE AWS_SDK_LOAD_CONFIG _assume_role _session_name STS_RESPONSE
32+
2033# Update the version in Cargo.toml
2134perl -pe " s/^version = .*$/version = \" $1 \" /" < Cargo.toml > new_Cargo.toml
2235mv new_Cargo.toml Cargo.toml
@@ -26,7 +39,7 @@ find src -depth 1 | egrep -v '(intercept.rs|lib.rs|software_externs.rs|README)'
2639
2740# Change to the parent directory and run make polymorph and transpile commands
2841cd ../..
29- make polymorph_rust transpile_rust test_rust
42+ make polymorph_rust transpile_rust test_rust test_rust_debug
3043
3144# Remove target directory
3245cd runtimes/rust
@@ -43,13 +56,22 @@ cd ../../../releases/rust/db_esdk
4356git checkout dafny_runtime_rust
4457
4558# Remove unnecessary files and directories
46- rm -rf * ~ copy_externs.sh start_release.sh test_published.sh test_examples * .pem RELEASE.md src/README.md
59+ rm -rf * ~ copy_externs.sh upgrade_examples.sh start_release.sh test_published.sh test_examples * .pem RELEASE.md src/README.md
4760
4861# Create .gitignore file with specified entries
4962echo Cargo.lock > .gitignore
5063echo target >> .gitignore
5164
65+ # format the generated code
66+ cargo fmt
67+
68+ # replace local path with latest dafny-runtime from crates.io
69+ cargo rm dafny-runtime
70+ cargo add dafny-runtime -F sync
71+
5272# Run cargo test and example tests
73+ cargo test --release
74+ cargo run --release --example main
5375cargo test
5476cargo run --example main
5577
0 commit comments