Skip to content

Commit

Permalink
ci-plutus-benchmark: add git ref info
Browse files Browse the repository at this point in the history
Include git refs for base and PR branches in the comment added to PRs
as response to `/benchmark`
  • Loading branch information
gilligan committed Jun 30, 2021
1 parent 0596b79 commit 1ecbbe0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/ci-plutus-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..."
Expand Down

0 comments on commit 1ecbbe0

Please sign in to comment.