From f982158f42df65f2ddf295df9b92d74be6357d44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 3 Sep 2025 13:45:17 -0500 Subject: [PATCH] tools/ci.sh: Let code_size_build be customized via environment. For instance, to compare HEAD to origin/master on only the minimal x86 build, use PORTS_TO_CHECK=m REFERENCE=origin/master tools/ci.sh code_size_build Signed-off-by: Jeff Epler --- tools/ci.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/ci.sh b/tools/ci.sh index e6f33416b0..1e5a7e5420 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -82,16 +82,20 @@ function ci_code_size_setup { function ci_code_size_build { # check the following ports for the change in their code size - PORTS_TO_CHECK=bmusxpdv + # Override the list by setting PORTS_TO_CHECK in the environment before invoking ci. + : ${PORTS_TO_CHECK:=bmusxpdv} + SUBMODULES="lib/asf4 lib/berkeley-db-1.xx lib/btstack lib/cyw43-driver lib/lwip lib/mbedtls lib/micropython-lib lib/nxp_driver lib/pico-sdk lib/stm32lib lib/tinyusb" # Default GitHub pull request sets HEAD to a generated merge commit # between PR branch (HEAD^2) and base branch (i.e. master) (HEAD^1). # # We want to compare this generated commit with the base branch, to see what - # the code size impact would be if we merged this PR. - REFERENCE=$(git rev-parse --short HEAD^1) - COMPARISON=$(git rev-parse --short HEAD) + # the code size impact would be if we merged this PR. During CI we are at a merge commit, + # so this tests the merged PR against its merge base. + # Override the refs by setting REFERENCE and/or COMPARISON in the environment before invoking ci. + : ${REFERENCE:=$(git rev-parse --short HEAD^1)} + : ${COMPARISON:=$(git rev-parse --short HEAD)} echo "Comparing sizes of reference ${REFERENCE} to ${COMPARISON}..." git log --oneline $REFERENCE..$COMPARISON