Skip to content

Commit c9d1bb9

Browse files
committed
ci: add option to specify custom range
This is useful when running the script locally on a set of commits to reproduce how things are run in CI. Signed-off-by: Anas Nashif <[email protected]>
1 parent 8642be0 commit c9d1bb9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/ci/run_ci.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# -r the remote to rebase on
1616
#
1717
# The script can be run locally using for exmaple:
18-
# ./scripts/ci/run_ci.sh -b master -r origin -l
18+
# ./scripts/ci/run_ci.sh -b master -r origin -l -R <commit range>
1919

2020
set -xe
2121

@@ -30,7 +30,7 @@ WEST_COMMANDS_RESULTS_FILE="./pytest_out/west_commands.xml"
3030
MATRIX_BUILDS=1
3131
MATRIX=1
3232

33-
while getopts ":p:m:b:r:M:cfsl" opt; do
33+
while getopts ":p:m:b:r:M:cfslR:" opt; do
3434
case $opt in
3535
c)
3636
echo "Execute CI" >&2
@@ -69,6 +69,10 @@ while getopts ":p:m:b:r:M:cfsl" opt; do
6969
echo "Remote: $OPTARG" >&2
7070
REMOTE=$OPTARG
7171
;;
72+
R)
73+
echo "Range: $OPTARG" >&2
74+
RANGE=$OPTARG
75+
;;
7276
\?)
7377
echo "Invalid option: -$OPTARG" >&2
7478
;;
@@ -94,6 +98,9 @@ if [ -n "$MAIN_CI" ]; then
9498
COMMIT_RANGE=$REMOTE/${BRANCH}..HEAD
9599
echo "Commit range:" ${COMMIT_RANGE}
96100
fi
101+
if [ -n "$RANGE" ]; then
102+
COMMIT_RANGE=$RANGE
103+
fi
97104
source zephyr-env.sh
98105
SANITYCHECK="${ZEPHYR_BASE}/scripts/sanitycheck"
99106

0 commit comments

Comments
 (0)