Skip to content

Commit f982158

Browse files
jeplerdpgeorge
authored andcommitted
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>
1 parent 2c34497 commit f982158

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/ci.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ function ci_code_size_setup {
8282

8383
function ci_code_size_build {
8484
# check the following ports for the change in their code size
85-
PORTS_TO_CHECK=bmusxpdv
85+
# Override the list by setting PORTS_TO_CHECK in the environment before invoking ci.
86+
: ${PORTS_TO_CHECK:=bmusxpdv}
87+
8688
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"
8789

8890
# Default GitHub pull request sets HEAD to a generated merge commit
8991
# between PR branch (HEAD^2) and base branch (i.e. master) (HEAD^1).
9092
#
9193
# We want to compare this generated commit with the base branch, to see what
92-
# the code size impact would be if we merged this PR.
93-
REFERENCE=$(git rev-parse --short HEAD^1)
94-
COMPARISON=$(git rev-parse --short HEAD)
94+
# the code size impact would be if we merged this PR. During CI we are at a merge commit,
95+
# so this tests the merged PR against its merge base.
96+
# Override the refs by setting REFERENCE and/or COMPARISON in the environment before invoking ci.
97+
: ${REFERENCE:=$(git rev-parse --short HEAD^1)}
98+
: ${COMPARISON:=$(git rev-parse --short HEAD)}
9599

96100
echo "Comparing sizes of reference ${REFERENCE} to ${COMPARISON}..."
97101
git log --oneline $REFERENCE..$COMPARISON

0 commit comments

Comments
 (0)