From 1ecbbe0334927323b65148dab1e63f1920d56513 Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Wed, 30 Jun 2021 10:58:53 +0200 Subject: [PATCH] ci-plutus-benchmark: add git ref info Include git refs for base and PR branches in the comment added to PRs as response to `/benchmark` --- scripts/ci-plutus-benchmark.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ci-plutus-benchmark.sh b/scripts/ci-plutus-benchmark.sh index 8ff7e9dbb3e..b2be069c535 100755 --- a/scripts/ci-plutus-benchmark.sh +++ b/scripts/ci-plutus-benchmark.sh @@ -30,6 +30,7 @@ if [ -z "$PR_NUMBER" ] ; then exit 1 fi echo "[ci-plutus-benchmark]: Processing benchmark comparison for PR $PR_NUMBER" +PR_BRANCH_REF=$(git show-ref -s HEAD) echo "[ci-plutus-benchmark]: Updating cabal database ..." cabal update @@ -39,12 +40,14 @@ cabal bench plutus-benchmark:validation >bench-PR.log 2>&1 echo "[ci-plutus-benchmark]: Switching branches ..." git checkout "$(git merge-base HEAD master)" +BASE_BRANCH_REF=$(git show-ref -s HEAD) echo "[ci-plutus-benchmark]: Running benchmark for base branch ..." cabal bench plutus-benchmark:validation >bench-base.log 2>&1 echo "[ci-plutus-benchmark]: Comparing results ..." -./plutus-benchmark/bench-compare bench-base.log bench-PR.log >bench-compare-result.log +echo -e "Comparing benchmark results of '$BASE_BRANCH_REF' (base) and '$PR_BRANCH_REF' (PR)\n" >bench-compare-result.log +./plutus-benchmark/bench-compare bench-base.log bench-PR.log >>bench-compare-result.log nix-shell -p jq --run "jq -Rs '.' bench-compare-result.log >bench-compare.json" echo "[ci-plutus-benchmark]: Posting results to GitHub ..."