roc/ci/basic_nightly_test.sh

56 lines
1.3 KiB
Bash
Raw Normal View History

2023-07-17 17:09:35 +03:00
#!/usr/bin/env bash
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
# if to prevent unset vars errror
if [ -n "$(ls | grep -v "roc_nightly.*tar\.gz" | grep -v "^ci$")" ]; then
# Remove everything in this dir except the tar and ci folder.
# We want to test like a user who would have downloaded the release, so we clean up all files from the repo checkout.
to_delete=$(ls | grep -v "roc_nightly.*tar\.gz" | grep -v "^ci$")
for file_or_dir in $to_delete
do
echo "Removing: $file_or_dir"
rm -rf "$file_or_dir"
done
fi
2023-07-17 17:09:35 +03:00
2023-10-27 17:19:11 +03:00
if [[ "$(uname)" == "Darwin" ]]; then
brew install z3 # used by llvm
fi
2023-07-17 17:09:35 +03:00
# decompress the tar
ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf
# delete tar
ls | grep "roc_nightly.*tar\.gz" | xargs rm -rf
# rename nightly folder
mv roc_nightly* roc_nightly
cd roc_nightly
# test roc hello world
2023-08-18 19:18:04 +03:00
./roc examples/helloWorld.roc
2023-09-16 15:54:44 +03:00
# test rust platform
2023-07-17 17:09:35 +03:00
./roc examples/platform-switching/rocLovesRust.roc
2023-10-27 17:19:11 +03:00
# test zig platform
./roc examples/platform-switching/rocLovesZig.roc
2023-07-17 17:09:35 +03:00
2023-09-16 15:54:44 +03:00
# test C platform
2023-07-17 17:09:35 +03:00
./roc examples/platform-switching/rocLovesC.roc
2023-09-16 15:54:44 +03:00
# test repl
2023-09-19 17:14:27 +03:00
cd ../ci/repl_basic_test
cargo build --release
2023-09-19 17:18:04 +03:00
cp target/release/repl_basic_test ../../roc_nightly
2023-09-19 17:14:27 +03:00
cd ../../roc_nightly
./repl_basic_test
2023-09-16 15:54:44 +03:00
cd ..