Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/tests_alpha.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/tests_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-15-intel, macos-15]
operating-system: [ubuntu-24.04]
# TODO re-enable all operating systems
#operating-system: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-15-intel, macos-15, windows-2025, windows-11-arm]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4

- uses: roc-lang/setup-roc@39c354a6a838a0089eea9068a0414f49b62c5c08
- uses: roc-lang/setup-roc@30ff82b396cbeb36a662a18f5c652773efb43e72
with:
version: nightly
# Installs the latest nightly from https://github.com/roc-lang/nightlies
version: nightly-new-compiler

- name: Run Roc
run: roc version
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/tests_nix.yml

This file was deleted.

235 changes: 156 additions & 79 deletions ci_scripts/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,119 +15,196 @@ if [ -z "${ROC}" ]; then
exit 1
fi

$ROC build ./examples/HelloWorld/main.roc
expect ci_scripts/expect_scripts/HelloWorld.exp
# opt-in list of examples to test (add examples as they are updated for the new compiler)
optin=(
"Tuples"
)

is_optin() {
local name="$1"
for entry in "${optin[@]}"; do
if [[ "$entry" == "$name" ]]; then
return 0
fi
done
return 1
}

if is_optin "HelloWorld"; then
$ROC build ./examples/HelloWorld/main.roc
expect ci_scripts/expect_scripts/HelloWorld.exp
fi

$ROC build ./examples/FizzBuzz/main.roc
$ROC test ./examples/FizzBuzz/main.roc
expect ci_scripts/expect_scripts/FizzBuzz.exp
if is_optin "FizzBuzz"; then
$ROC build ./examples/FizzBuzz/main.roc
$ROC test ./examples/FizzBuzz/main.roc
expect ci_scripts/expect_scripts/FizzBuzz.exp
fi

$ROC test ./examples/GraphTraversal/Graph.roc
if is_optin "GraphTraversal"; then
$ROC test ./examples/GraphTraversal/Graph.roc
fi

$ROC build ./examples/Json/main.roc --linker=legacy
expect ci_scripts/expect_scripts/Json.exp
if is_optin "Json"; then
$ROC build ./examples/Json/main.roc --linker=legacy
expect ci_scripts/expect_scripts/Json.exp
fi

$ROC build ./examples/LeastSquares/main.roc
expect ci_scripts/expect_scripts/LeastSquares.exp
if is_optin "LeastSquares"; then
$ROC build ./examples/LeastSquares/main.roc
expect ci_scripts/expect_scripts/LeastSquares.exp
fi

$ROC build ./examples/IngestFiles/main.roc
expect ci_scripts/expect_scripts/IngestFiles.exp
if is_optin "IngestFiles"; then
$ROC build ./examples/IngestFiles/main.roc
expect ci_scripts/expect_scripts/IngestFiles.exp
fi

$ROC build ./examples/Parser/main.roc
$ROC test ./examples/Parser/main.roc
expect ci_scripts/expect_scripts/Parser.exp
if is_optin "Parser"; then
$ROC build ./examples/Parser/main.roc
$ROC test ./examples/Parser/main.roc
expect ci_scripts/expect_scripts/Parser.exp
fi

$ROC test ./examples/PatternMatching/PatternMatching.roc
if is_optin "PatternMatching"; then
$ROC test ./examples/PatternMatching/PatternMatching.roc
fi

$ROC build ./examples/AllSyntax/main.roc
expect ci_scripts/expect_scripts/AllSyntax.exp
if is_optin "AllSyntax"; then
$ROC build ./examples/AllSyntax/main.roc
expect ci_scripts/expect_scripts/AllSyntax.exp
fi

$ROC build ./examples/RandomNumbers/main.roc
expect ci_scripts/expect_scripts/RandomNumbers.exp
if is_optin "RandomNumbers"; then
$ROC build ./examples/RandomNumbers/main.roc
expect ci_scripts/expect_scripts/RandomNumbers.exp
fi

$ROC build ./examples/CommandLineArgs/main.roc
expect ci_scripts/expect_scripts/CommandLineArgs.exp
if is_optin "CommandLineArgs"; then
$ROC build ./examples/CommandLineArgs/main.roc
expect ci_scripts/expect_scripts/CommandLineArgs.exp
fi

$ROC build ./examples/Commands/main.roc
expect ci_scripts/expect_scripts/Commands.exp
if is_optin "Commands"; then
$ROC build ./examples/Commands/main.roc
expect ci_scripts/expect_scripts/Commands.exp
fi

$ROC build ./examples/CommandLineArgsFile/main.roc
expect ci_scripts/expect_scripts/CommandLineArgsFile.exp
if is_optin "CommandLineArgsFile"; then
$ROC build ./examples/CommandLineArgsFile/main.roc
expect ci_scripts/expect_scripts/CommandLineArgsFile.exp
fi

$ROC build ./examples/TryOperatorDesugaring/main.roc
$ROC test ./examples/TryOperatorDesugaring/main.roc
expect ci_scripts/expect_scripts/TryOperatorDesugaring.exp
if is_optin "TryOperatorDesugaring"; then
$ROC build ./examples/TryOperatorDesugaring/main.roc
$ROC test ./examples/TryOperatorDesugaring/main.roc
expect ci_scripts/expect_scripts/TryOperatorDesugaring.exp
fi

$ROC build ./examples/Tuples/main.roc
expect ci_scripts/expect_scripts/Tuples.exp
if is_optin "Tuples"; then
expect ci_scripts/expect_scripts/Tuples.exp
fi

$ROC test ./examples/TowersOfHanoi/Hanoi.roc
if is_optin "TowersOfHanoi"; then
$ROC test ./examples/TowersOfHanoi/Hanoi.roc
fi

$ROC test ./examples/ErrorHandlingBasic/ErrorHandlingBasic.roc
if is_optin "ErrorHandlingBasic"; then
$ROC test ./examples/ErrorHandlingBasic/ErrorHandlingBasic.roc
fi

$ROC build ./examples/ErrorHandlingRealWorld/main.roc
expect ci_scripts/expect_scripts/ErrorHandlingRealWorld.exp
if is_optin "ErrorHandlingRealWorld"; then
$ROC build ./examples/ErrorHandlingRealWorld/main.roc
expect ci_scripts/expect_scripts/ErrorHandlingRealWorld.exp
fi

$ROC build ./examples/LoopEffect/main.roc
expect ci_scripts/expect_scripts/LoopEffect.exp
if is_optin "LoopEffect"; then
$ROC build ./examples/LoopEffect/main.roc
expect ci_scripts/expect_scripts/LoopEffect.exp
fi

$ROC build ./examples/Snake/main.roc
$ROC test ./examples/Snake/main.roc
expect ci_scripts/expect_scripts/Snake.exp
if is_optin "Snake"; then
$ROC build ./examples/Snake/main.roc
$ROC test ./examples/Snake/main.roc
expect ci_scripts/expect_scripts/Snake.exp
fi

$ROC test ./examples/RecordBuilder/DateParser.roc
if is_optin "RecordBuilder"; then
$ROC test ./examples/RecordBuilder/DateParser.roc
fi

$ROC test ./examples/BasicDict/BasicDict.roc
if is_optin "BasicDict"; then
$ROC test ./examples/BasicDict/BasicDict.roc
fi

$ROC build ./examples/MultipleRocFiles/main.roc
expect ci_scripts/expect_scripts/MultipleRocFiles.exp
if is_optin "MultipleRocFiles"; then
$ROC build ./examples/MultipleRocFiles/main.roc
expect ci_scripts/expect_scripts/MultipleRocFiles.exp
fi

$ROC build ./examples/ImportFromDirectory/main.roc
expect ci_scripts/expect_scripts/ImportFromDirectory.exp
if is_optin "ImportFromDirectory"; then
$ROC build ./examples/ImportFromDirectory/main.roc
expect ci_scripts/expect_scripts/ImportFromDirectory.exp
fi

$ROC build ./examples/EncodeDecode/main.roc
expect ci_scripts/expect_scripts/EncodeDecode.exp
if is_optin "EncodeDecode"; then
$ROC build ./examples/EncodeDecode/main.roc
expect ci_scripts/expect_scripts/EncodeDecode.exp
fi

$ROC build ./examples/SafeMath/main.roc
$ROC test ./examples/SafeMath/main.roc
expect ci_scripts/expect_scripts/SafeMath.exp
if is_optin "SafeMath"; then
$ROC build ./examples/SafeMath/main.roc
$ROC test ./examples/SafeMath/main.roc
expect ci_scripts/expect_scripts/SafeMath.exp
fi

$ROC build ./examples/HelloWeb/main.roc --linker=legacy
expect ci_scripts/expect_scripts/HelloWeb.exp
if is_optin "HelloWeb"; then
$ROC build ./examples/HelloWeb/main.roc --linker=legacy
expect ci_scripts/expect_scripts/HelloWeb.exp
fi

$ROC build ./examples/ImportPackageFromModule/main.roc
expect ci_scripts/expect_scripts/ImportPackageFromModule.exp
if is_optin "ImportPackageFromModule"; then
$ROC build ./examples/ImportPackageFromModule/main.roc
expect ci_scripts/expect_scripts/ImportPackageFromModule.exp
fi

$ROC test ./examples/CustomInspect/OpaqueTypes.roc
if is_optin "CustomInspect"; then
$ROC test ./examples/CustomInspect/OpaqueTypes.roc
fi

$ROC build ./examples/SortStrings/main.roc
$ROC ./examples/SortStrings/main.roc
expect ci_scripts/expect_scripts/SortStrings.exp
if is_optin "SortStrings"; then
$ROC build ./examples/SortStrings/main.roc
$ROC ./examples/SortStrings/main.roc
expect ci_scripts/expect_scripts/SortStrings.exp
fi

# these examples don't work on macos and aarch64 linux yet #225 #226 #231
if [[ "$(uname)" == "Linux" && "$(uname -m)" == "x86_64" ]]; then
$ROC build --lib ./examples/GoPlatform/main.roc --output examples/GoPlatform/platform/libapp.so
go build -C examples/GoPlatform/platform -buildmode=pie -o dynhost

$ROC preprocess-host ./examples/GoPlatform/platform/dynhost ./examples/GoPlatform/platform/main.roc ./examples/GoPlatform/platform/libapp.so
$ROC build ./examples/GoPlatform/main.roc

# temporarily allow failure of lsb_release in case it is not installed
set +e
os_info=$(lsb_release -a 2>/dev/null)
set -e

# Skip Go tests if os is Ubuntu and we're not inside nix. This avoids a segfault on CI. See https://github.com/roc-lang/examples/issues/164
if echo "$os_info" | grep -q "Ubuntu" && [ -z "${IN_NIX_SHELL}" ]; then
echo "Skipping Go test due to https://github.com/roc-lang/examples/issues/164"
else
echo "Running Go test..."
expect ci_scripts/expect_scripts/GoPlatform.exp
if is_optin "GoPlatform"; then
$ROC build --lib ./examples/GoPlatform/main.roc --output examples/GoPlatform/platform/libapp.so
go build -C examples/GoPlatform/platform -buildmode=pie -o dynhost

$ROC preprocess-host ./examples/GoPlatform/platform/dynhost ./examples/GoPlatform/platform/main.roc ./examples/GoPlatform/platform/libapp.so
$ROC build ./examples/GoPlatform/main.roc

# temporarily allow failure of lsb_release in case it is not installed
set +e
os_info=$(lsb_release -a 2>/dev/null)
set -e

# Skip Go tests if os is Ubuntu and we're not inside nix. This avoids a segfault on CI. See https://github.com/roc-lang/examples/issues/164
if echo "$os_info" | grep -q "Ubuntu" && [ -z "${IN_NIX_SHELL}" ]; then
echo "Skipping Go test due to https://github.com/roc-lang/examples/issues/164"
else
echo "Running Go test..."
expect ci_scripts/expect_scripts/GoPlatform.exp
fi
fi


$ROC build ./examples/DotNetPlatform/main.roc --lib --output ./examples/DotNetPlatform/platform/interop
expect ci_scripts/expect_scripts/DotNetPlatform.exp
if is_optin "DotNetPlatform"; then
$ROC build ./examples/DotNetPlatform/main.roc --lib --output ./examples/DotNetPlatform/platform/interop
expect ci_scripts/expect_scripts/DotNetPlatform.exp
fi
fi

echo "All tests passed!"
Loading