ci(metrics): collapse Average Code Size Metrics table when no base

When no base metrics are available to compare against, the PR comment
falls back to the combined "TinyUSB Average Code Size Metrics" report
(build.yml copies metrics.md to metrics_compare.md). That posted the
full per-example size table inline, cluttering the comment.

Wrap the table in a <details><summary>Size table</summary> block so the
heading stays visible but the detail is collapsed by default, matching
the Size Difference Report's collapsible sections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
hathach
2026-06-18 17:19:03 +07:00
parent 941d63e39a
commit 202746d34d

View File

@ -384,9 +384,9 @@ def render_combine_table(json_data, sort_order='name+'):
def write_combine_markdown(json_data, path, sort_order='name+', title="TinyUSB Average Code Size Metrics"):
"""Write averaged size data to a markdown file."""
md_lines = [f"## {title}", ""]
md_lines = [f"## {title}", "", "<details><summary>Size table</summary>", ""]
md_lines.extend(render_combine_table(json_data, sort_order))
md_lines.append("")
md_lines.extend(["", "</details>", ""])
if json_data.get("file_list"):
md_lines.extend(["<details>", "<summary>Input files</summary>", ""])