From c4e72e691f63dc7fefbf65cdfd51181502957f78 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 25 Nov 2024 16:42:09 +0100 Subject: [PATCH] .github: output size diff output to summary --- .github/workflows/test_size.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test_size.yml b/.github/workflows/test_size.yml index 5ee9f13033..fe83756a3a 100644 --- a/.github/workflows/test_size.yml +++ b/.github/workflows/test_size.yml @@ -301,8 +301,26 @@ jobs: Tools/scripts/extract_features.py "$EF_BASE_BRANCH_BINARY" -nm "${BIN_PREFIX}nm" >features-base_branch.txt Tools/scripts/extract_features.py "$EF_PR_BRANCH_BINARY" -nm "${BIN_PREFIX}nm" >features-pr.txt diff -u features-base_branch.txt features-pr.txt || true + diff_output=$(diff -u features-base_branch.txt features-pr.txt || true) + echo "### Features Diff Output" >> $GITHUB_STEP_SUMMARY + if [ -n "$diff_output" ]; then + echo '```diff' >> $GITHUB_STEP_SUMMARY + echo "$diff_output" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + else + echo "No differences found." >> $GITHUB_STEP_SUMMARY + fi - name: Checksum compare with ${{ github.event.pull_request.base.ref }} shell: bash run: | diff -r $GITHUB_WORKSPACE/base_branch_bin_no_versions $GITHUB_WORKSPACE/pr_bin_no_versions --exclude=*.elf --exclude=*.apj || true + diff_output=$(diff -r $GITHUB_WORKSPACE/base_branch_bin_no_versions $GITHUB_WORKSPACE/pr_bin_no_versions --exclude=*.elf --exclude=*.apj || true || true) + echo "### Checksum Diff Output" >> $GITHUB_STEP_SUMMARY + if [ -n "$diff_output" ]; then + echo '```diff' >> $GITHUB_STEP_SUMMARY + echo "$diff_output" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + else + echo "No differences found." >> $GITHUB_STEP_SUMMARY + fi