diff mbox series

[v2,10/12] .travis.yml: move cache flushing to early common phase

Message ID 20200130113223.31046-11-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show
Series testing/next (with build fixes!) | expand

Commit Message

Alex Bennée Jan. 30, 2020, 11:32 a.m. UTC
We shall be adding more common early setup in a future commit.

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

Comments

Philippe Mathieu-Daudé Jan. 31, 2020, 3:31 p.m. UTC | #1
On 1/30/20 12:32 PM, Alex Bennée wrote:
> We shall be adding more common early setup in a future commit.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   .travis.yml | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index f245765cfe..1b92f40eab 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -82,11 +82,16 @@ git:
>     # we want to do this ourselves
>     submodules: false
>   
> +# Common first phase for all steps
> +before_install:
> +  - if command -v ccache ; then ccache --zero-stats ; fi

Odd, this rule is called 'before_install' but is run *after* the 
addons:apt:packages list is installed.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>   
> +# Configure step - may be overridden
>   before_script:
> -  - if command -v ccache ; then ccache --zero-stats ; fi
>     - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
>     - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
> +
> +# Main build & test - rarely overridden - controlled by TEST_CMD
>   script:
>     - BUILD_RC=0 && make -j3 || BUILD_RC=$?
>     - if [ "$BUILD_RC" -eq 0 ] ; then travis_retry ${TEST_CMD} ; else $(exit $BUILD_RC); fi
> @@ -268,7 +273,6 @@ matrix:
>         before_script:
>           - brew link --overwrite python
>           - export PATH="/usr/local/opt/ccache/libexec:$PATH"
> -        - if command -v ccache ; then ccache --zero-stats ; fi
>           - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
>           - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
>   
> @@ -499,9 +503,6 @@ matrix:
>           - TEST_CMD="make install -j3"
>           - QEMU_VERSION="${TRAVIS_TAG:1}"
>           - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
> -      before_script:
> -        - command -v ccache && ccache --zero-stats
> -        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
>         script:
>           - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
>           - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
>
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index f245765cfe..1b92f40eab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,11 +82,16 @@  git:
   # we want to do this ourselves
   submodules: false
 
+# Common first phase for all steps
+before_install:
+  - if command -v ccache ; then ccache --zero-stats ; fi
 
+# Configure step - may be overridden
 before_script:
-  - if command -v ccache ; then ccache --zero-stats ; fi
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
+
+# Main build & test - rarely overridden - controlled by TEST_CMD
 script:
   - BUILD_RC=0 && make -j3 || BUILD_RC=$?
   - if [ "$BUILD_RC" -eq 0 ] ; then travis_retry ${TEST_CMD} ; else $(exit $BUILD_RC); fi
@@ -268,7 +273,6 @@  matrix:
       before_script:
         - brew link --overwrite python
         - export PATH="/usr/local/opt/ccache/libexec:$PATH"
-        - if command -v ccache ; then ccache --zero-stats ; fi
         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
         - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 
@@ -499,9 +503,6 @@  matrix:
         - TEST_CMD="make install -j3"
         - QEMU_VERSION="${TRAVIS_TAG:1}"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
-      before_script:
-        - command -v ccache && ccache --zero-stats
-        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
       script:
         - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
         - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2