travis: Enable OSX tests
authorVittorio Giovara <vittorio@vimeo.com>
Tue, 17 Nov 2015 17:08:26 +0100
changeset 11410 1b9e183841e7
parent 11406 2d659747b991
child 11411 0566458ffdfc
travis: Enable OSX tests Clean up other parts while at it.
.travis.yml
--- a/.travis.yml	Mon Nov 16 23:06:27 2015 +0100
+++ b/.travis.yml	Tue Nov 17 17:08:26 2015 +0100
@@ -1,7 +1,10 @@
 language: c
+os:
+  - linux
+  - osx
 branches:
-  except:
-    gh-pages
+  only:
+    master
 compiler:
   - gcc
   - clang
@@ -11,15 +14,41 @@
   - BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1"
   - BUILD_ARGS="-DNOSERVER=1 -DNOVIDEOREC=1 -DNOPNG=1"
   - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0 -DPHYSFS_SYSTEM=0"
-matrix:
-  allow_failures:
-    # Failures we expect here
-before_install:
-  - sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
-  - sudo apt-get update -qq
-  - sudo apt-get install debhelper cmake dpkg-dev libqt4-dev qt4-qmake libphysfs-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-net-dev bzip2 ghc libghc-mtl-dev libghc-parsec3-dev libghc-bytestring-show-dev libghc-vector-dev libghc-zlib-dev libghc-random-dev libghc-stm-dev libghc-network-dev libghc-dataenc-dev libghc-hslogger-dev libghc-utf8-string-dev libghc-sha-dev libghc-entropy-dev liblua5.1-0-dev imagemagick fpc fp-compiler fp-units-misc libpng-dev fp-units-gfx libavcodec-dev libavformat-dev libglew1.6-dev
-script: 
-  - mkdir build && cd build && cmake $BUILD_ARGS .. && make VERBOSE=1 && make test_verbose
+before_install: |
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+    sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
+    sudo apt-get update -qq
+  elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
+    brew update --all
+  fi
+install: |
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+    sudo apt-get install debhelper cmake dpkg-dev libqt4-dev qt4-qmake libphysfs-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-net-dev bzip2 ghc libghc-mtl-dev libghc-parsec3-dev libghc-bytestring-show-dev libghc-vector-dev libghc-zlib-dev libghc-random-dev libghc-stm-dev libghc-network-dev libghc-dataenc-dev libghc-hslogger-dev libghc-utf8-string-dev libghc-sha-dev libghc-entropy-dev liblua5.1-0-dev imagemagick fpc fp-compiler fp-units-misc libpng-dev fp-units-gfx libavcodec-dev libavformat-dev libglew1.6-dev
+  elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
+    brew install fpc glew qt physfs lua51 sdl2 sdl2_image sdl2_net sdl2_ttf ffmpeg ghc cabal-install
+    brew install sdl2_mixer --with-vorbis
+    # use cabal install haskell deps, pas2c ones are covered by server
+    if [[ "$BUILD_ARGS" != *"NOSERVER"* ]]; then
+      cabal update
+      cabal install --only-dependencies gameServer/hedgewars-server.cabal
+    fi
+    if [[ "$BUILD_ARGS" == *"BUILD_ENGINE_C"* ]]; then
+      cabal update
+      cabal install --only-dependencies tools/pas2c/pas2c.cabal
+    fi
+    # avoid installing Sparkle, add default unit path
+    export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1 -DCMAKE_Pascal_FLAGS=-Fu/usr/local/lib/fpc/$(fpc -iW)/units/x86_64-darwin/*/"
+  fi
+before_script:
+  - mkdir build && cd build && cmake $BUILD_ARGS ..
+script:
+  - make VERBOSE=1
+after_success: |
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+    make test_verbose
+  elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
+    make install
+  fi
 notifications:
   email: false
   irc:
@@ -30,3 +59,4 @@
       - "See details at %{build_url}"
     on_success: change
     on_failure: always
+    skip_join: true