From 88e469d0a11cc7b143c17715f5c36a9faa3141fe Mon Sep 17 00:00:00 2001 From: Brummel Date: Mon, 4 May 2026 09:38:04 +0200 Subject: [PATCH] feat: Add project integrity check script This script automates checks for formatting, linting, building, and testing across all Cargo workspaces and the Wear OS Gradle build. It provides a summary of all stages, indicating PASS, WARN, or FAIL. The script's exit code reflects the number of failed stages. --- scripts/check.sh | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 scripts/check.sh 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