Add code block in benchcmp output (#2140)

This commit is contained in:
Brad Beam
2018-09-27 10:05:05 -05:00
committed by Miek Gieben
parent ae2a0c62b7
commit f9526742af

View File

@@ -5,7 +5,10 @@ set -e +o pipefail
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
echo -e "NOTE: The CPU benchmarks are performed on Travis VMs and vary widly between runs," > .benchmark.body echo -e "NOTE: The CPU benchmarks are performed on Travis VMs and vary widly between runs," > .benchmark.body
echo -e " you can't trust them. The memory benchmarks are OK\n\n" >> .benchmark.body echo -e " you can't trust them. The memory benchmarks are OK\n\n" >> .benchmark.body
cat .benchmark.log >> .benchmark.body awk '/^benchmark old/ { printf "%s\n%s\n", "```", $0 };
/^$/ { print "```" };
/^Bench/ { print $0 };
END{ print "```" }' .benchmark.log >> .benchmark.body
jq -n --arg body "$(cat .benchmark.body)" '{body: $body}' > .benchmark.json jq -n --arg body "$(cat .benchmark.body)" '{body: $body}' > .benchmark.json
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \ curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
--data-binary "@.benchmark.json" \ --data-binary "@.benchmark.json" \