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).
This commit is contained in:
parent
5c8bf12acf
commit
4371c971e3
15
.travis.yml
15
.travis.yml
@ -308,15 +308,22 @@ jobs:
|
|||||||
- gcc --version
|
- gcc --version
|
||||||
- arm-none-eabi-gcc --version
|
- arm-none-eabi-gcc --version
|
||||||
script:
|
script:
|
||||||
- git checkout -b pull_request
|
# starts off at either the ref/pull/N/merge FETCH_HEAD, or the current branch HEAD
|
||||||
- git checkout master
|
- 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
|
- git show -s
|
||||||
- tools/metrics.py clean bm
|
- 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 checkout pull_request
|
||||||
- git show -s
|
- git log upstream/master..HEAD
|
||||||
- tools/metrics.py clean bm
|
- tools/metrics.py clean bm
|
||||||
- tools/metrics.py build bm | tee ~/size1 || travis_terminate 1
|
- 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
|
- tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
|
||||||
|
|
||||||
# cc3200 port
|
# cc3200 port
|
||||||
|
Loading…
Reference in New Issue
Block a user