Files
aiken/examples/acceptance_tests/run
KtorZ fe7d744946 Split continuous workflow in three jobs.
Doing all steps sequentially is starting to get long. Several of those checks are unrelated and can be done in parallel.
2024-07-16 17:41:14 +02:00

38 lines
853 B
Bash
Executable File

#!/usr/bin/env bash
if [ -z $1 ]; then
echo -e "\033[31mMissing argument: \033[1mACCEPTANCE_TEST\033[0m"
echo ""
echo -e "\033[1mUsage: \033[0m"
echo " run.sh {ACCEPTANCE_TEST}"
echo ""
echo -e "\033[1mExample: \033[0m"
echo " run.sh 034"
exit 1
fi
WORKDIR="$(dirname -- "${BASH_SOURCE[0]}")"
TARGET="$WORKDIR/$(basename $1)"
TMP=$(mktemp)
VALIDATORS=$(find $TARGET -type f -path "*validators/*.ak")
cargo run -r --quiet -- check $TARGET 1>$TMP 2>/dev/null
if [ "$?" -eq "0" ]; then
if [ -z "$VALIDATORS" ]; then
echo "$(basename $TARGET)"
else
cargo run -r --quiet -- build $TARGET 1>$TMP 2>/dev/null
if [ "$?" -eq "0" ]; then
echo "$(basename $TARGET)"
else
echo "$(basename $TARGET)"
cat $TMP
exit 1
fi
fi
else
echo "$(basename $TARGET)"
cat $TMP
exit 1
fi