Skip to content

Commit

Permalink
make scripts runnable locally
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewilliamboswell committed Jan 19, 2024
1 parent d5376a3 commit c4cf702
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: ./roc_nightly/roc version

# Run all tests
- run: ./ci/all_tests.sh
- run: ROC=./roc_nightly/roc ./ci/all_tests.sh

# TODO clippy, rustfmt, roc fmt check

16 changes: 12 additions & 4 deletions ci/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail

roc='./roc_nightly/roc'
if [ -z "${ROC}" ]; then
echo "ERROR: The ROC environment variable is not set.
Set it to something like:
/home/username/Downloads/roc_nightly-linux_x86_64-2023-10-30-cb00cfb/roc
or
/home/username/gitrepos/roc/target/build/release/roc" >&2

exit 1
fi

examples_dir='./examples/'

# roc check
for roc_file in $examples_dir*.roc; do
$roc check $roc_file
$ROC check $roc_file
done

# roc build
architecture=$(uname -m)

for roc_file in $examples_dir*.roc; do
$roc build $roc_file
$ROC build $roc_file
done

# test building website
$roc docs platform/main.roc
$ROC docs platform/main.roc

0 comments on commit c4cf702

Please sign in to comment.