diff --git a/.github/parse_benchmark_results.sh b/.github/parse_benchmark_results.sh new file mode 100755 index 000000000..23ef0bbc8 --- /dev/null +++ b/.github/parse_benchmark_results.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# Parse benchmark results from game tests and convert to JSON format +# This script reads the benchmark results file and converts it to JSON format +# for use with benchmark-action/github-action-benchmark + +set -e + +BENCH_FILE="benchmark_results.json" +RESULTS_FILE="runs/gameTestServer/logs/benchmark_results.txt" + +echo "Parsing benchmark results..." + +# Initialize the JSON array +echo "[" > "$BENCH_FILE" + +# Default values if file doesn't exist +if [ ! -f "$RESULTS_FILE" ]; then + echo "Benchmark results file not found at $RESULTS_FILE" + exit 1; +fi + +FIRST=true +while IFS= read -r line; do + # Skip empty lines + if [ -z "$line" ]; then + continue + fi + + # Parse the line: preset= size= avgNetworkTickTime=