-
-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: Add build size comparison workflow
Add .github/workflows/getSize.sh to extract sizes of sections from the objfile build-firmware uses getSize.sh to output the section sizes. get-base-ref-size job added, which builds the base branch of the PR and outputs the section sizes. Caches are used to avoid unnecessary builds when the base branch hasn't been updated. leave-build-size-comment job added, which creates or updates a comment on the PR with the build size information from other jobs.
- Loading branch information
Showing
2 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# Requires environment variables from docker/build.sh | ||
|
||
set -e | ||
|
||
SIZE_BIN="$TOOLS_DIR/$GCC_ARM_PATH/bin/arm-none-eabi-size" | ||
[ ! -x "$SIZE_BIN" ] && exit 1 | ||
|
||
[ -z "$1" ] && exit 1 | ||
SIZE_OUTPUT=$($SIZE_BIN "$1" | tail -n1) | ||
|
||
TEXT_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 1 |tr -d '[:blank:]') | ||
DATA_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 2 |tr -d '[:blank:]') | ||
BSS_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 3 |tr -d '[:blank:]') | ||
|
||
echo "text_size=$TEXT_SIZE" | ||
echo "data_size=$DATA_SIZE" | ||
echo "bss_size=$BSS_SIZE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters