diff --git a/scripts/check.sh b/scripts/check.sh new file mode 100755 index 0000000..739cc8e --- /dev/null +++ b/scripts/check.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +# Project integrity check after a refactor. +# Runs fmt, clippy, build and tests for every Cargo world plus the Wear OS Gradle build. +# All stages run even if earlier ones fail. A summary table is printed at the end. +# Exit code equals the number of FAIL stages (WARN stages do not count). + +set -u +set -o pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +export JAVA_HOME="/opt/android-studio/jbr" + +# Colors only when stdout is a terminal +if [[ -t 1 ]]; then + C_RESET=$'\e[0m' + C_RED=$'\e[31m' + C_GREEN=$'\e[32m' + C_YELLOW=$'\e[33m' + C_BOLD=$'\e[1m' +else + C_RESET="" + C_RED="" + C_GREEN="" + C_YELLOW="" + C_BOLD="" +fi + +# Stage results, parallel arrays +STAGE_NAMES=() +STAGE_STATUS=() +STAGE_SECONDS=() +FAIL_COUNT=0 + +# run_stage