summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-19 09:16:36 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-22 14:04:01 +1000
commit8267f0866cf6d4b583cc3f6e8c4e15a3d81142c6 (patch)
tree7d88d0340dd1cc3aeaeb1087f0fbafd495ba668c
parent17dc86369f018caaee0b81740619bb1ca5a5f891 (diff)
travis: Use tools/metrics.py to compute size diff of minimal ports.
This is to make the Travis CI size check more robust, by not relying on the saved firmware from a previous build (which may use a different compiler, environment, etc) but rather compile both master and the PR and diff them. This size check now checks both bare-arm and minimal x86-32 builds (before it just checked minimal Cortex-M build).
-rw-r--r--.travis.yml23
1 files changed, 14 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index c0a4bcaea..a9daa1f25 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -297,21 +297,26 @@ jobs:
- make ${MAKEOPTS} -C ports/nrf submodules
- make ${MAKEOPTS} -C ports/nrf
- # bare-arm and minimal ports
+ # bare-arm and minimal ports, with size-diff check
- stage: test
- env: NAME="bare-arm and minimal ports build"
+ env: NAME="bare-arm and minimal ports build and size-diff check"
install:
+ - sudo apt-get install gcc-multilib libffi-dev:i386
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
+ - gcc --version
- arm-none-eabi-gcc --version
script:
- - make ${MAKEOPTS} -C ports/bare-arm
- - make ${MAKEOPTS} -C ports/minimal CROSS=1 build/firmware.bin
- - ls -l ports/minimal/build/firmware.bin
- - tools/check_code_size.sh
- - mkdir -p ${HOME}/persist
- # Save new firmware for reference, but only if building a main branch, not a pull request
- - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
+ - git checkout -b pull_request
+ - git checkout master
+ - git show -s
+ - tools/metrics.py clean bm
+ - tools/metrics.py build bm | tee ~/size0 || travis_terminate 1
+ - git checkout pull_request
+ - git show -s
+ - tools/metrics.py clean bm
+ - tools/metrics.py build bm | tee ~/size1 || travis_terminate 1
+ - tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
# cc3200 port
- stage: test