Skip to content

Commit

Permalink
update CI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewilliamboswell committed Jan 27, 2024
1 parent 13347c4 commit a30eb5d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3


# get roc cli
- name: get latest roc nightly
run: |
curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz
Expand All @@ -31,10 +32,9 @@ jobs:

- run: ./roc_nightly/roc version

- run: sudo apt install -y expect
# expect for testing

- run: sudo apt install -y expect
- run: expect -v

# Run all tests
- run: ./ci/all_tests.sh
# run all tests
- run: ROC=./roc_nightly/roc ./ci/all_tests.sh
31 changes: 20 additions & 11 deletions ci/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
# 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

examples_dir='./examples/'
exit 1
fi

EXAMPLES_DIR='./examples'
PACKAGE_DIR='./package'

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

# roc build
for roc_file in $examples_dir*.roc; do
$roc build $roc_file --linker=legacy
for ROC_FILE in $EXAMPLES_DIR/*.roc; do
$ROC build $ROC_FILE --linker=legacy
done

# check output
for roc_file in $examples_dir*.roc; do
roc_file_only="$(basename "$roc_file")"
no_ext_name=${roc_file_only%.*}
expect ci/expect_scripts/$no_ext_name.exp
for ROC_FILE in $EXAMPLES_DIR/*.roc; do
ROC_FILE_ONLY="$(basename "$ROC_FILE")"
NO_EXT_NAME=${ROC_FILE_ONLY%.*}
expect ci/expect_scripts/$NO_EXT_NAME.exp
done

# test building docs website
$roc docs package/main.roc
$ROC docs $PACKAGE_DIR/main.roc

0 comments on commit a30eb5d

Please sign in to comment.