Skip to content

Commit

Permalink
chore: Format canbench output so diffs can be seen more easily (#257)
Browse files Browse the repository at this point in the history
Since Github does not support colored text, I chose to use colored
emojis.

Demo:
<img width="408" alt="Screenshot 2024-12-02 at 17 25 12"
src="https://github.com/user-attachments/assets/9588c9ea-e2ec-48b4-8289-59b38ce829f7">
  • Loading branch information
frankdavid authored Dec 2, 2024
1 parent 7d55893 commit 3b995f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/ci_run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ if [ -f "$MAIN_BRANCH_RESULTS_FILE" ]; then
fi
fi

# Add emojis for visualization (as of December 2024, Github does not support colored text)
FORMATTED_CANBENCH_OUTPUT=$(cat "$CANBENCH_OUTPUT" \
| sed -E 's/.*improved.*/\0 🟢/g' \
| sed -E 's/.*regress.*/\0 🔴/g')

## Add the output of canbench to the file.
{
echo "$UPDATED_MSG"
echo ""
echo "\`\`\`"
cat "$CANBENCH_OUTPUT"
echo "$FORMATTED_CANBENCH_OUTPUT"
echo "\`\`\`"
} >> "$COMMENT_MESSAGE_PATH"

Expand Down

0 comments on commit 3b995f5

Please sign in to comment.