mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2025-12-31 09:49:13 +03:00
Skip running benchmarks when latest commit is already benchmarked (#66)
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#
|
||||
# NOTE: This script is tailored for the dedicated benchmarking server.
|
||||
# It is not meant for local usage or experimentation.
|
||||
# `sudo` must be able to work non-interactively for the script to succeed.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
@@ -36,6 +35,20 @@ if [[ ! -d "$GODOT_REPO_DIR/.git" ]]; then
|
||||
git clone https://github.com/godotengine/godot.git "$GODOT_REPO_DIR"
|
||||
fi
|
||||
|
||||
# Check if latest commit is already benchmarked in the results repository. If so, skip running the benchmark.
|
||||
rm -rf /tmp/godot-benchmarks-results/
|
||||
git clone git@github.com:godotengine/godot-benchmarks-results.git /tmp/godot-benchmarks-results/
|
||||
latest_commit="$(git -C "$GODOT_REPO_DIR" rev-parse HEAD)"
|
||||
|
||||
pushd /tmp/godot-benchmarks-results/
|
||||
for result in 2*.md; do
|
||||
if [[ "${result:11:9}" == "${latest_commit:0:9}" ]]; then
|
||||
echo "godot-benchmarks: Skipping benchmark run as the latest Godot commit is already present in the results repository."
|
||||
exit
|
||||
fi
|
||||
done
|
||||
popd
|
||||
|
||||
GODOT_EMPTY_PROJECT_DIR="$DIR/web/godot-empty-project"
|
||||
|
||||
if [[ "$ARG1" != "--skip-build" ]]; then
|
||||
@@ -156,12 +169,9 @@ $GODOT_RELEASE --audio-driver Dummy --gpu-index 1 -- --run-benchmarks --include-
|
||||
$GODOT_RELEASE --audio-driver Dummy --gpu-index 0 -- --run-benchmarks --include-benchmarks="rendering/*" --save-json="/tmp/intel.md" --json-results-prefix="intel"
|
||||
#$GODOT_RELEASE --audio-driver Dummy --gpu-index 2 -- --run-benchmarks --include-benchmarks="rendering/*" --save-json="/tmp/nvidia.md" --json-results-prefix="nvidia"
|
||||
|
||||
rm -rf /tmp/godot-benchmarks-results/
|
||||
# Clone a copy of the repository so we can push the new JSON files to it.
|
||||
# We cloned a copy of the repository above so we can push the new JSON files to it.
|
||||
# The website build is performed by GitHub Actions on the `main` branch of the repository below,
|
||||
# so we only push files to it and do nothing else.
|
||||
git clone git@github.com:godotengine/godot-benchmarks-results.git /tmp/godot-benchmarks-results/
|
||||
|
||||
cd /tmp/godot-benchmarks-results/
|
||||
|
||||
# Merge benchmark run JSONs together.
|
||||
|
||||
Reference in New Issue
Block a user