Travis CI: Specify test configurations using 'matrix:include'
authorIvan Maidanski <ivmai@mail.ru>
Mon, 3 Apr 2017 19:21:26 +0000 (22:21 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 3 Apr 2017 19:27:51 +0000 (22:27 +0300)
(Cherry-pick commits d808080, 64c5c71, ad3932a from 'master' branch.)

Also, require "sudo" only where needed.

.travis.yml

index 56accad..b58a18c 100644 (file)
@@ -1,32 +1,42 @@
 language: c
 
-os:
-  - linux
-  - osx
-
-compiler:
-  - clang
-  - gcc
-
-env:
-  - CFLAGS_EXTRA_M=
-  - CFLAGS_EXTRA="-O3 -march=native"
-      CONF_ASSERTIONS=--enable-assertions
-  - CFLAGS_EXTRA_M=-m32
-      CFLAGS_EXTRA="-march=native"
-      CONF_ASSERTIONS=--enable-assertions
-
 matrix:
-  exclude:
-  - os: osx
-    compiler: gcc
-
-sudo: required
-
-before_install:
-  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CFLAGS_EXTRA_M" == "-m32" ]]; then
-      sudo apt-get install gcc-multilib;
-    fi
+  include:
+    - os: linux
+      compiler: clang
+    - os: linux
+      compiler: gcc
+    - os: osx
+    - os: linux
+      compiler: clang
+      env:
+        - CFLAGS_EXTRA="-O3 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
+    - os: linux
+      compiler: gcc
+      env:
+        - CFLAGS_EXTRA="-O3 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
+    - os: osx
+      env:
+        - CFLAGS_EXTRA="-O3 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
+    - os: linux
+      addons: { apt: { packages: [ gcc-multilib ] } }
+      compiler: clang
+      env:
+        - CFLAGS_EXTRA="-m32 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
+    - os: linux
+      addons: { apt: { packages: [ gcc-multilib ] } }
+      compiler: gcc
+      env:
+        - CFLAGS_EXTRA="-m32 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
+    - os: osx
+      env:
+        - CFLAGS_EXTRA="-m32 -march=native"
+        - CONF_ASSERTIONS=--enable-assertions
 
 install:
   - ./autogen.sh
@@ -34,5 +44,5 @@ install:
 script:
   - ./configure $CONF_ASSERTIONS
   - cat src/config.h
-  - make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA $CFLAGS_EXTRA_M"
+  - make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA"
   - if [ -f tests/test_atomic.log ]; then cat tests/test_atomic*.log; fi