diff mbox

[v2,11/21] travis: cache git submodules

Message ID 20170622033231.19344-12-f4bug@amsat.org
State New
Headers show

Commit Message

Philippe Mathieu-Daudé June 22, 2017, 3:32 a.m. UTC
Travis caching uses the branch name to store packed cache, so each new branch
will trigger a cache miss and will clone all submodules. Subsequent builds will
benefit from the cache.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .travis.yml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Alex Bennée June 22, 2017, 10:17 a.m. UTC | #1
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Travis caching uses the branch name to store packed cache, so each new branch
> will trigger a cache miss and will clone all submodules. Subsequent builds will
> benefit from the cache.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

\o/

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---
>  .travis.yml | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 62b9dfd2ae..777914f759 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -7,6 +7,8 @@ compiler:
>  cache:
>    ccache: true
>    timeout: 1200 # https://docs.travis-ci.com/user/caching#setting-the-timeout
> +  directories:
> +  - $HOME/qemu/.git/modules
>  addons:
>    apt:
>      packages:
> @@ -74,7 +76,6 @@ git:
>  before_install:
>    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
>    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libffi gettext glib pixman ; fi
> -  - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>    - git submodule update --init --recursive
>  before_script:
>    - ./configure ${CONFIG}
> @@ -113,7 +114,6 @@ matrix:
>        before_install:
>          - sudo apt-get update -qq
>          - sudo apt-get build-dep -qq qemu
> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>          - git submodule update --init --recursive
>      # Plain Trusty Linux User Build
>      - env: CONFIG="--disable-system"
> @@ -124,7 +124,6 @@ matrix:
>        before_install:
>          - sudo apt-get update -qq
>          - sudo apt-get build-dep -qq qemu
> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>          - git submodule update --init --recursive
>      # Trusty System build with latest stable clang
>      - sudo: required
> @@ -142,7 +141,6 @@ matrix:
>          - travis_retry sudo apt-get update -qq
>          - travis_retry sudo apt-get install -qq -y clang-3.9
>          - sudo apt-get build-dep -qq qemu
> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>          - git submodule update --init --recursive
>        before_script:
>          - ./configure ${CONFIG} || cat config.log
> @@ -162,7 +160,6 @@ matrix:
>          - travis_retry sudo apt-get update -qq
>          - travis_retry sudo apt-get install -qq -y clang-3.9
>          - sudo apt-get build-dep -qq qemu
> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>          - git submodule update --init --recursive
>        before_script:
>          - ./configure ${CONFIG} || cat config.log


--
Alex Bennée
Alex Bennée June 22, 2017, 1:51 p.m. UTC | #2
Alex Bennée <alex.bennee@linaro.org> writes:

> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>
>> Travis caching uses the branch name to store packed cache, so each new branch
>> will trigger a cache miss and will clone all submodules. Subsequent builds will
>> benefit from the cache.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> \o/
>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

Hmmm looking deeper it doesn't look as though we are benefiting from the
caching here. The submodule checkout is around 60-70s with some jobs
coming down to 30-40s. The old system seems to be ~20s for the
wget/checkout step (assuming the wget is cached).

>
>
>> ---
>>  .travis.yml | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 62b9dfd2ae..777914f759 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -7,6 +7,8 @@ compiler:
>>  cache:
>>    ccache: true
>>    timeout: 1200 # https://docs.travis-ci.com/user/caching#setting-the-timeout
>> +  directories:
>> +  - $HOME/qemu/.git/modules
>>  addons:
>>    apt:
>>      packages:
>> @@ -74,7 +76,6 @@ git:
>>  before_install:
>>    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
>>    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libffi gettext glib pixman ; fi
>> -  - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>>    - git submodule update --init --recursive
>>  before_script:
>>    - ./configure ${CONFIG}
>> @@ -113,7 +114,6 @@ matrix:
>>        before_install:
>>          - sudo apt-get update -qq
>>          - sudo apt-get build-dep -qq qemu
>> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>>          - git submodule update --init --recursive
>>      # Plain Trusty Linux User Build
>>      - env: CONFIG="--disable-system"
>> @@ -124,7 +124,6 @@ matrix:
>>        before_install:
>>          - sudo apt-get update -qq
>>          - sudo apt-get build-dep -qq qemu
>> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>>          - git submodule update --init --recursive
>>      # Trusty System build with latest stable clang
>>      - sudo: required
>> @@ -142,7 +141,6 @@ matrix:
>>          - travis_retry sudo apt-get update -qq
>>          - travis_retry sudo apt-get install -qq -y clang-3.9
>>          - sudo apt-get build-dep -qq qemu
>> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>>          - git submodule update --init --recursive
>>        before_script:
>>          - ./configure ${CONFIG} || cat config.log
>> @@ -162,7 +160,6 @@ matrix:
>>          - travis_retry sudo apt-get update -qq
>>          - travis_retry sudo apt-get install -qq -y clang-3.9
>>          - sudo apt-get build-dep -qq qemu
>> -        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
>>          - git submodule update --init --recursive
>>        before_script:
>>          - ./configure ${CONFIG} || cat config.log


--
Alex Bennée
diff mbox

Patch

diff --git a/.travis.yml b/.travis.yml
index 62b9dfd2ae..777914f759 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,8 @@  compiler:
 cache:
   ccache: true
   timeout: 1200 # https://docs.travis-ci.com/user/caching#setting-the-timeout
+  directories:
+  - $HOME/qemu/.git/modules
 addons:
   apt:
     packages:
@@ -74,7 +76,6 @@  git:
 before_install:
   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libffi gettext glib pixman ; fi
-  - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
   - git submodule update --init --recursive
 before_script:
   - ./configure ${CONFIG}
@@ -113,7 +114,6 @@  matrix:
       before_install:
         - sudo apt-get update -qq
         - sudo apt-get build-dep -qq qemu
-        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
         - git submodule update --init --recursive
     # Plain Trusty Linux User Build
     - env: CONFIG="--disable-system"
@@ -124,7 +124,6 @@  matrix:
       before_install:
         - sudo apt-get update -qq
         - sudo apt-get build-dep -qq qemu
-        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
         - git submodule update --init --recursive
     # Trusty System build with latest stable clang
     - sudo: required
@@ -142,7 +141,6 @@  matrix:
         - travis_retry sudo apt-get update -qq
         - travis_retry sudo apt-get install -qq -y clang-3.9
         - sudo apt-get build-dep -qq qemu
-        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
         - git submodule update --init --recursive
       before_script:
         - ./configure ${CONFIG} || cat config.log
@@ -162,7 +160,6 @@  matrix:
         - travis_retry sudo apt-get update -qq
         - travis_retry sudo apt-get install -qq -y clang-3.9
         - sudo apt-get build-dep -qq qemu
-        - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
         - git submodule update --init --recursive
       before_script:
         - ./configure ${CONFIG} || cat config.log