[v1,1/1] travis: cache dpdk directory

Message ID 1500631207-4981-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • travis: cache dpdk directory
Related show

Commit Message

Github ODP bot July 21, 2017, 10 a.m.
From: Matias Elo <matias.elo@nokia.com>


Cache DPDK directory so each individual test doesn't have to download and
build the code. Speeds up each tests which require dpdk by ~3 minutes.

Signed-off-by: Matias Elo <matias.elo@nokia.com>

---
/** Email created from pull request 84 (matiaselo:dev/travis_caching)
 ** https://github.com/Linaro/odp/pull/84
 ** Patch: https://github.com/Linaro/odp/pull/84.patch
 ** Base sha: 3eeb249a4774f12d2d16ca349a591654eae620ae
 ** Merge commit sha: 7ed0e1dac9782ec8d154d478b6a3e75b4c3af9a4
 **/
 .travis.yml | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/.travis.yml b/.travis.yml
index 42c2c963..e3d74882 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,9 @@ 
 # See https://scan.coverity.com/travis_ci
 
 language: c
+cache:
+  directories:
+  - dpdk
 sudo: required
 dist: trusty
 group: deprecated-2017Q2
@@ -108,17 +111,21 @@  install:
         - gem install asciidoctor
         - PATH=${PATH//:\.\/node_modules\/\.bin/}
 
-#	DPDK pktio
+#	DPDK pktio. Note that cache must be purged if dpdk version changes.
         - TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
-        - git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk
-        - pushd dpdk
-        - git log --oneline --decorate
-        - make config T=${TARGET} O=${TARGET}
-        - pushd ${TARGET}
-        - sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
-        - popd
-        - make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
-        - popd
+        - |
+          if [ ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then
+            git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk
+            pushd dpdk
+            git log --oneline --decorate
+            make config T=${TARGET} O=${TARGET}
+            pushd ${TARGET}
+            sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+            popd
+            make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+            rm -r ./doc ./${TARGET}/app ./${TARGET}/build
+            popd
+          fi
 
 #	Netmap pktio
         - git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v11.2 https://github.com/luigirizzo/netmap.git