@@ -17,6 +17,19 @@ if [ $MATCHES -eq 0 ]; then
17
17
exit 1
18
18
fi
19
19
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
+
20
33
# Update the version in Cargo.toml
21
34
perl -pe " s/^version = .*$/version = \" $1 \" /" < Cargo.toml > new_Cargo.toml
22
35
mv new_Cargo.toml Cargo.toml
@@ -26,7 +39,7 @@ find src -depth 1 | egrep -v '(intercept.rs|lib.rs|software_externs.rs|README)'
26
39
27
40
# Change to the parent directory and run make polymorph and transpile commands
28
41
cd ../..
29
- make polymorph_rust transpile_rust test_rust
42
+ make polymorph_rust transpile_rust test_rust test_rust_debug
30
43
31
44
# Remove target directory
32
45
cd runtimes/rust
@@ -43,13 +56,22 @@ cd ../../../releases/rust/db_esdk
43
56
git checkout dafny_runtime_rust
44
57
45
58
# 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
47
60
48
61
# Create .gitignore file with specified entries
49
62
echo Cargo.lock > .gitignore
50
63
echo target >> .gitignore
51
64
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
+
52
72
# Run cargo test and example tests
73
+ cargo test --release
74
+ cargo run --release --example main
53
75
cargo test
54
76
cargo run --example main
55
77
0 commit comments