Use ccache in Travis (#64)

* Use ccache in Travis

This should speed up builds as we are rebuilding the same libvirt
versions and it takes over half of test run time.

* Show ccache stats before and after building libvirt
This commit is contained in:
Yuriy Taraday 2018-03-02 00:00:12 +04:00 committed by Ben LeMasurier
parent 0978bc3291
commit 6075ea3c39

View File

@ -3,13 +3,20 @@ os: linux
dist: trusty dist: trusty
sudo: require sudo: require
cache:
directories:
- $HOME/.ccache
go: go:
- "1.10" - "1.10"
env: env:
- LIBVIRT=1.2.12 EXT=gz global:
- LIBVIRT=2.3.0 EXT=xz - CCACHE_TEMPDIR=/tmp/.ccache-temp
- LIBVIRT=3.1.0 EXT=xz matrix:
- LIBVIRT=1.2.12 EXT=gz
- LIBVIRT=2.3.0 EXT=xz
- LIBVIRT=3.1.0 EXT=xz
before_install: before_install:
- go get github.com/golang/lint/golint - go get github.com/golang/lint/golint
@ -24,13 +31,16 @@ install:
- curl -O -s https://libvirt.org/sources/libvirt-${LIBVIRT}.tar.${EXT} - curl -O -s https://libvirt.org/sources/libvirt-${LIBVIRT}.tar.${EXT}
- tar -C /usr/src -xf libvirt-${LIBVIRT}.tar.${EXT} - tar -C /usr/src -xf libvirt-${LIBVIRT}.tar.${EXT}
- pushd /usr/src/libvirt-${LIBVIRT} - pushd /usr/src/libvirt-${LIBVIRT}
- ccache --show-stats
- | - |
env PATH=/usr/lib/ccache:$PATH \
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \ ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
--without-polkit \ --without-polkit \
--without-esx --without-vbox --without-xen --without-libxl --without-lxc \ --without-esx --without-vbox --without-xen --without-libxl --without-lxc \
--with-qemu --with-qemu
- make - make
- sudo make install - sudo make install
- ccache --show-stats
- popd - popd
- sudo libvirtd -d -l -f libvirtd.conf - sudo libvirtd -d -l -f libvirtd.conf
- sudo virtlogd -d || true - sudo virtlogd -d || true