forked from near/near-sdk-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-test.sh
executable file
·39 lines (31 loc) · 1 KB
/
ci-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
if [[ "${NEAR_RELEASE}" == "true" ]]; then
echo "Test with release version of borsh and near-vm-logic"
sed -n '/^borsh/p' near-sdk/Cargo.toml
sed -n '/^near-vm-logic/p' near-sdk/Cargo.toml
cargo test --all
else
echo "Test with git version of borsh and near-vm-logic"
cargo generate-lockfile
cp Cargo.toml{,.bak}
cp Cargo.lock{,.bak}
sed -i "" "s|###||g" Cargo.toml
set +e
cargo test --all
status=$?
set -e
mv Cargo.toml{.bak,}
mv Cargo.lock{.bak,}
if [ $status -ne 0 ]; then
exit $status
fi
# Only testing it for one configuration to avoid running the same tests twice
echo "Build wasm32 for all examples"
./examples/build_all_docker.sh --check
echo "Testing all examples"
./examples/test_all.sh
# TODO re-enable when parsing unknown sections is fixed in twiggy
# https://github.com/rustwasm/twiggy/pull/576
# echo "Checking size of all example contracts"
# ./examples/size_all.sh
fi