From 8267f0866cf6d4b583cc3f6e8c4e15a3d81142c6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 19 Apr 2020 09:16:36 +1000 Subject: [PATCH] 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). --- .travis.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c0a4bcaea7..a9daa1f257 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