summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2023-10-11 08:13:53 +1100
committerDamien George <damien@micropython.org>2023-10-11 14:05:14 +1100
commitd2a9d70c0977f02b4d52fa5e6d31f17c2a7aa313 (patch)
treed4c8d15356359e42a1800392b3bf7e3b7a1b8ef6 /tools
parent9f835df35e1628974437cdf87334667a9e2ce3c5 (diff)
tools/ci.sh: Ensure enough commits are fetched for a common ancestor.
This commit updates the ci script to automatically fetch all upstream if the common commit hasn't been found; this should preserve the speed of CI checks for most PR's, and use a reliable but slow fetch if needed for older ones. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ci.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/ci.sh b/tools/ci.sh
index efa492bd1..975ce8617 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -44,7 +44,9 @@ function ci_code_spell_run {
function ci_commit_formatting_run {
git remote add upstream https://github.com/micropython/micropython.git
- git fetch --depth=100 upstream master
+ git fetch --depth=100 upstream master
+ # If the common ancestor commit hasn't been found, fetch more.
+ git merge-base upstream/master HEAD || git fetch --unshallow upstream master
# For a PR, upstream/master..HEAD ends with a merge commit into master, exclude that one.
tools/verifygitlog.py -v upstream/master..HEAD --no-merges
}
@@ -68,6 +70,8 @@ function ci_code_size_build {
git checkout -b pull_request # save the current location
git remote add upstream https://github.com/micropython/micropython.git
git fetch --depth=100 upstream master
+ # If the common ancestor commit hasn't been found, fetch more.
+ git merge-base upstream/master HEAD || git fetch --unshallow upstream master
# build reference, save to size0
# ignore any errors with this build, in case master is failing
git checkout `git merge-base --fork-point upstream/master pull_request`