[RFC PATCH] travis.yml: split into build stages

Alex Bennée posted 1 patch 4 years, 3 months ago
Failed in applying to current master (apply log)
.travis.yml | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
[RFC PATCH] travis.yml: split into build stages
Posted by Alex Bennée 4 years, 3 months ago
The idea of this is split the build across stages so any failure in
one stage will save time running later stages. So far I have have
arbitrarily chosen:

  canary: up-front quick to build and run
  platforms: common build configurations
  rest: everything else

The ideal should be canary and platforms catch the most common and
frequent build breakages and the "rest" aims for completeness.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .travis.yml | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6c1038a0f1a..648c523ce59 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,8 +17,12 @@ cache:
   pip: true
   directories:
   - $HOME/avocado/data/cache
+stages:
+  - canary
+  - platforms
+  - rest
 
-
+  
 addons:
   apt:
     packages:
@@ -97,17 +101,20 @@ matrix:
     - env:
         - CONFIG="--disable-system --static"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: canary
 
 
     # we split the system builds as it takes a while to build them all
     - env:
         - CONFIG="--disable-user --target-list=${MAIN_SOFTMMU_TARGETS}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: canary
 
 
     - env:
         - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: canary
 
 
     # Just build tools and run minimal unit and softfloat checks
@@ -116,28 +123,33 @@ matrix:
         - CONFIG="--disable-user --disable-system"
         - TEST_CMD="make check-unit check-softfloat -j3"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: canary
 
 
     # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
     - env:
         - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
+      stage: rest
 
 
     # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
     - env:
         - CONFIG="--enable-debug-tcg --disable-system"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
+      stage: rest
 
-
+      
     - env:
         - CONFIG="--disable-linux-aio --disable-cap-ng --disable-attr --disable-brlapi --disable-libusb --disable-replication --target-list=${MAIN_SOFTMMU_TARGETS}"
+      stage: rest
 
 
     # Module builds are mostly of interest to major distros
     - env:
         - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: rest
 
 
     # Alternate coroutines implementations are only really of interest to KVM users
@@ -145,11 +157,13 @@ matrix:
     - env:
         - CONFIG="--with-coroutine=ucontext --disable-tcg"
         - TEST_CMD="make check-unit -j3 V=1"
+      stage: rest
 
 
     - env:
         - CONFIG="--with-coroutine=sigaltstack --disable-tcg"
         - TEST_CMD="make check-unit -j3 V=1"
+      stage: rest
 
 
     # Check we can build docs and tools (out of tree)
@@ -158,6 +172,7 @@ matrix:
         - BASE_CONFIG="--enable-tools --enable-docs"
         - CONFIG="--target-list=x86_64-softmmu,aarch64-linux-user"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
+      stage: rest
       addons:
         apt:
           packages:
@@ -171,11 +186,13 @@ matrix:
         - CONFIG="--disable-system"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
       compiler: clang
+      stage: platforms
 
 
     - env:
         - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} "
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
+      stage: platforms
       compiler: clang
       before_script:
         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
@@ -185,12 +202,14 @@ matrix:
     - env:
         - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
+      stage: platforms
       compiler: clang
 
 
     # gprof/gcov are GCC features
     - env:
         - CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=${MAIN_SOFTMMU_TARGETS}"
+      stage: rest
       after_success:
         - ${SRC_DIR}/scripts/travis/coverage-summary.sh
 
@@ -200,6 +219,7 @@ matrix:
         - CONFIG="--without-default-devices --disable-user"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
         - TEST_CMD=""
+      stage: rest
 
 
     # Check the TCG interpreter (TCI)
@@ -207,22 +227,26 @@ matrix:
         - CONFIG="--enable-debug-tcg --enable-tcg-interpreter --disable-kvm --disable-containers
             --target-list=alpha-softmmu,arm-softmmu,hppa-softmmu,m68k-softmmu,microblaze-softmmu,moxie-softmmu,ppc-softmmu,s390x-softmmu,x86_64-softmmu"
         - TEST_CMD="make check-qtest check-tcg V=1"
+      stage: rest
 
 
     # We don't need to exercise every backend with every front-end
     - env:
         - CONFIG="--enable-trace-backends=log,simple,syslog --disable-system"
         - TEST_CMD=""
+      stage: rest
 
 
     - env:
         - CONFIG="--enable-trace-backends=ftrace --target-list=x86_64-softmmu"
         - TEST_CMD=""
+      stage: rest
 
 
     - env:
         - CONFIG="--enable-trace-backends=ust --target-list=x86_64-softmmu"
         - TEST_CMD=""
+      stage: rest
 
 
     # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
@@ -232,6 +256,7 @@ matrix:
       os: osx
       osx_image: xcode10.3
       compiler: clang
+      stage: platforms
       addons:
         homebrew:
           packages:
@@ -256,6 +281,7 @@ matrix:
       language: python
       python:
         - "3.5"
+      stage: platforms
 
 
     - env:
@@ -264,6 +290,7 @@ matrix:
       language: python
       python:
         - "3.6"
+      stage: platforms
 
 
     # Acceptance (Functional) tests
@@ -272,6 +299,7 @@ matrix:
         - TEST_CMD="make check-acceptance"
       after_script:
         - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
+      stage: rest
       addons:
         apt:
           packages:
@@ -321,6 +349,7 @@ matrix:
             - uuid-dev
       language: generic
       compiler: none
+      stage: platforms
       env:
         - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
         - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-pie --disable-linux-user"
@@ -343,6 +372,7 @@ matrix:
         - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user"
         - TEST_CMD="make -j3 check-tcg V=1"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
+      stage: rest
 
 
     # Run check-tcg against softmmu targets
@@ -383,6 +413,7 @@ matrix:
           - libusb-1.0-0-dev
           - libvdeplug-dev
           - libvte-2.91-dev
+      stage: platforms
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
@@ -412,6 +443,7 @@ matrix:
           - libusb-1.0-0-dev
           - libvdeplug-dev
           - libvte-2.91-dev
+      stage: platforms
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
@@ -441,6 +473,7 @@ matrix:
           - libusb-1.0-0-dev
           - libvdeplug-dev
           - libvte-2.91-dev
+      stage: platforms
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
-- 
2.20.1


Re: [RFC PATCH] travis.yml: split into build stages
Posted by Thomas Huth 4 years, 3 months ago
On 08/01/2020 23.49, Alex Bennée wrote:
> The idea of this is split the build across stages so any failure in
> one stage will save time running later stages. So far I have have
> arbitrarily chosen:
> 
>   canary: up-front quick to build and run
>   platforms: common build configurations
>   rest: everything else
> 
> The ideal should be canary and platforms catch the most common and
> frequent build breakages and the "rest" aims for completeness.

I like that idea. Just two nits:

> diff --git a/.travis.yml b/.travis.yml
> index 6c1038a0f1a..648c523ce59 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -17,8 +17,12 @@ cache:
>    pip: true
>    directories:
>    - $HOME/avocado/data/cache
> +stages:
> +  - canary
> +  - platforms
> +  - rest
>  
> -
> +  

White space damage #1

>  addons:
>    apt:
>      packages:
[...]
> @@ -116,28 +123,33 @@ matrix:
>          - CONFIG="--disable-user --disable-system"
>          - TEST_CMD="make check-unit check-softfloat -j3"
>          - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
> +      stage: canary
>  
>  
>      # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
>      - env:
>          - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
>          - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
> +      stage: rest
>  
>  
>      # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
>      - env:
>          - CONFIG="--enable-debug-tcg --disable-system"
>          - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
> +      stage: rest
>  
> -
> +      

White space damage #2

>      - env:
>          - CONFIG="--disable-linux-aio --disable-cap-ng --disable-attr --disable-brlapi --disable-libusb --disable-replication --target-list=${MAIN_SOFTMMU_TARGETS}"
> +      stage: rest
[...]
> @@ -272,6 +299,7 @@ matrix:
>          - TEST_CMD="make check-acceptance"
>        after_script:
>          - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
> +      stage: rest
>        addons:
>          apt:
>            packages:
> @@ -321,6 +349,7 @@ matrix:
>              - uuid-dev
>        language: generic
>        compiler: none
> +      stage: platforms
>        env:
>          - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
>          - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-pie --disable-linux-user"

Could you maybe also make sure that we've got the same order of the tags
everywhere? Currently, you sometimes use "stage" before "env" and
sometimes after "env", that's a little bit confusing.

 Thomas