travis: improve .travis.yml
[android/external-libkmsxx.git] / .travis.yml
index 2a2ce18dd5ed7d96713f6c2d59c5e3a4ece5e30b..4526c2e3f0c81c1e2153a59f1f3fec294e18b530 100644 (file)
@@ -5,6 +5,18 @@ dist: trusty
 # Enable C++ support
 language: cpp
 
+addons:
+  apt:
+    sources: &sources
+      - ubuntu-toolchain-r-test
+    packages: &packages
+      - libegl1-mesa-dev
+      - libgles2-mesa-dev
+      - libwayland-dev
+      - libx11-xcb-dev
+      - libx11-dev
+      - libgbm-dev
+
 # Need MYCC and MYCXX as travis overwrites CC and CXX
 
 matrix:
@@ -12,29 +24,29 @@ matrix:
     - compiler: gcc
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-4.8', 'libegl1-mesa-dev', 'libgles2-mesa-dev', 'libwayland-dev',  'libx11-xcb-dev',  'libx11-dev',  'libgbm-dev']
+          sources: *sources
+          packages: [*packages, 'g++-4.8']
       env: MYCC=gcc-4.8 MYCXX=g++-4.8
 
     - compiler: gcc
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-4.9', 'libegl1-mesa-dev', 'libgles2-mesa-dev', 'libwayland-dev',  'libx11-xcb-dev',  'libx11-dev',  'libgbm-dev']
+          sources: *sources
+          packages: [*packages, 'g++-4.9']
       env: MYCC=gcc-4.9 MYCXX=g++-4.9
 
     - compiler: gcc
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-5', 'libegl1-mesa-dev', 'libgles2-mesa-dev', 'libwayland-dev',  'libx11-xcb-dev',  'libx11-dev',  'libgbm-dev']
+          sources: *sources
+          packages: [*packages, 'g++-5']
       env: MYCC=gcc-5 MYCXX=g++-5
 
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
-          packages: ['clang-3.8', 'libegl1-mesa-dev', 'libgles2-mesa-dev', 'libwayland-dev',  'libx11-xcb-dev',  'libx11-dev',  'libgbm-dev']
+          sources: [*sources, 'llvm-toolchain-precise-3.8']
+          packages: [*packages, 'clang-3.8']
       env: MYCC=clang-3.8 MYCXX=clang++-3.8
 
 # Build steps