summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-30 11:18:32 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-30 23:04:39 +1000
commit4371c971e3dfb743388ccb493c137a25aa9cdd35 (patch)
tree87fb6897eb19b8ff64d52965b9373f5c1db78df6
parent5c8bf12acf3d4cc4cebf971a6f61508559a28143 (diff)
travis: Make sure upstream/master exists when computing size-diff check.
Explicitly add the repository as upstream and fetch the master commit. This makes this bare-arm/minimal job more robust when finding the fork-point of a PR relative to upstream/master (especially for forks of this repo).
-rw-r--r--.travis.yml15
1 files changed, 11 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index abade8736..deb4a9254 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -308,15 +308,22 @@ jobs:
- gcc --version
- arm-none-eabi-gcc --version
script:
- - git checkout -b pull_request
- - git checkout master
+ # starts off at either the ref/pull/N/merge FETCH_HEAD, or the current branch HEAD
+ - git checkout -b pull_request # save the current location
+ - git remote add upstream https://github.com/micropython/micropython.git
+ - git fetch --depth=100 upstream
+ # 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`
- git show -s
- tools/metrics.py clean bm
- - tools/metrics.py build bm | tee ~/size0 || travis_terminate 1
+ - tools/metrics.py build bm | tee ~/size0 || true
+ # build PR/branch, save to size1
- git checkout pull_request
- - git show -s
+ - git log upstream/master..HEAD
- tools/metrics.py clean bm
- tools/metrics.py build bm | tee ~/size1 || travis_terminate 1
+ # compute diff of the code sizes
- tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
# cc3200 port