Skip to content

Commit 4371c97

Browse files
committed
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).
1 parent 5c8bf12 commit 4371c97

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.travis.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,22 @@ jobs:
308308
- gcc --version
309309
- arm-none-eabi-gcc --version
310310
script:
311-
- git checkout -b pull_request
312-
- git checkout master
311+
# starts off at either the ref/pull/N/merge FETCH_HEAD, or the current branch HEAD
312+
- git checkout -b pull_request # save the current location
313+
- git remote add upstream https://github.com/micropython/micropython.git
314+
- git fetch --depth=100 upstream
315+
# build reference, save to size0
316+
# ignore any errors with this build, in case master is failing
317+
- git checkout `git merge-base --fork-point upstream/master pull_request`
313318
- git show -s
314319
- tools/metrics.py clean bm
315-
- tools/metrics.py build bm | tee ~/size0 || travis_terminate 1
320+
- tools/metrics.py build bm | tee ~/size0 || true
321+
# build PR/branch, save to size1
316322
- git checkout pull_request
317-
- git show -s
323+
- git log upstream/master..HEAD
318324
- tools/metrics.py clean bm
319325
- tools/metrics.py build bm | tee ~/size1 || travis_terminate 1
326+
# compute diff of the code sizes
320327
- tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
321328

322329
# cc3200 port

0 commit comments

Comments
 (0)