#!/bin/bash

# Colors for output
CYAN='\033[0;36m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NOCOLOR='\033[0m'

# Run tests before push
echo -e "\n${CYAN}Running tests...${NOCOLOR}"
cd "$(git rev-parse --show-toplevel)/core" && go test ./...
status=$?
if [ $status -ne 0 ]; then
  echo -e "${RED}Push aborted: some tests failed.${NOCOLOR}"
  exit 1
else
  echo -e "${GREEN}All tests passed. Proceeding with push.${NOCOLOR}"
fi
