Skip to content

Commit 51a1f0a

Browse files
committed
[Test] Embed svg images in summary
Signed-off-by: Antón Casas <[email protected]>
1 parent d59afed commit 51a1f0a

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/performance.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,31 +172,39 @@ jobs:
172172
if: always()
173173
shell: bash
174174
run: |
175+
set -euo pipefail
175176
b64() { base64 --wrap=0 "$1" 2>/dev/null || base64 -w0 "$1"; }
177+
176178
CPP=$(b64 plots/complete_profile_plot.svg)
179+
CORE=$(b64 plots/core_profile_plot.svg)
180+
STACK=$(b64 plots/stack_plot.svg)
181+
BSS=$(b64 plots/profiles_bss_plot.svg)
182+
DATA=$(b64 plots/profiles_data_plot.svg)
183+
TEXT=$(b64 plots/profiles_text_plot.svg)
184+
177185
{
178186
echo "## 📊 Performance Metrics (last 52 runs)"
179187
echo
180188
echo "The workflow triggering this run can be found in the default branch."
181189
echo "The python scripts and the data used to generate these plots can be found in the [memory/performance](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/tree/memory/performance) branch."
182190
echo "The scripts and data can be modified without affecting develop nor master branches."
183-
echo "memory/performance branch is unprotected and can be pushed to in case any manual modifications are needed."
191+
echo "The \`memory/performance\` branch is unprotected and can be pushed to in case any manual modifications are needed."
184192
echo
185193
echo "### Complete Profile"
186-
echo "![Complete Profile](data:image/svg;base64,${CPP})"
194+
echo "<img src=\"data:image/svg+xml;base64,${CPP}\" alt=\"Complete Profile\" width=\"700\"/>"
187195
echo
188196
echo "### Core Profile"
189-
echo "![Core Profile](./plots/core_profile_plot.svg)"
197+
echo "<img src=\"data:image/svg+xml;base64,${CORE}\" alt=\"Core Profile\" width=\"700\"/>"
190198
echo
191199
echo "### Simple App Stack Usage"
192-
echo "![Stack](./plots/stack_plot.svg)"
200+
echo "<img src=\"data:image/svg+xml;base64,${STACK}\" alt=\"Stack\" width=\"700\"/>"
193201
echo
194202
echo "### Increase of .bss memory by enabling profiles"
195-
echo "![.bss Profiles](./plots/profiles_bss_plot.svg)"
203+
echo "<img src=\"data:image/svg+xml;base64,${BSS}\" alt=\"bss\" width=\"700\"/>"
196204
echo
197205
echo "### Increase of .data memory by enabling profiles"
198-
echo "![.data Profiles](./plots/profiles_data_plot.svg)"
206+
echo "<img src=\"data:image/svg+xml;base64,${DATA}\" alt=\"data\" width=\"700\"/>"
199207
echo
200208
echo "### Increase of .text memory by enabling profiles"
201-
echo "![.text Profiles](./plots/profiles_text_plot.svg)"
209+
echo "<img src=\"data:image/svg+xml;base64,${TEXT}\" alt=\"text\" width=\"700\"/>"
202210
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)