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 <jepler@unpythonic.net>
This commit is contained in:
Jeff Epler
2025-09-03 13:45:17 -05:00
committed by Damien George
parent 2c34497bd1
commit f982158f42

View File

@@ -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