diff --git a/.travis.yml b/.travis.yml index 9308ccf87..c35d29201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,26 @@ +os: + - linux + - osx language: cpp -compiler: - - gcc branches: only: - master - /openmw-.*$/ before_install: - - pwd - - echo "yes" | sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" - - echo "yes" | sudo apt-add-repository ppa:openmw/openmw - - sudo apt-get update -qq - - sudo apt-get install -qq libgtest-dev google-mock - - sudo apt-get install -qq libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libboost-wave-dev - - sudo apt-get install -qq libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev - - sudo apt-get install -qq libbullet-dev libogre-1.9-dev libmygui-dev libsdl2-dev libunshield-dev libtinyxml-dev libopenal-dev libqt4-dev - - sudo mkdir /usr/src/gtest/build - - cd /usr/src/gtest/build - - sudo cmake .. -DBUILD_SHARED_LIBS=1 - - sudo make -j4 - - sudo ln -s /usr/src/gtest/build/libgtest.so /usr/lib/libgtest.so - - sudo ln -s /usr/src/gtest/build/libgtest_main.so /usr/lib/libgtest_main.so + - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./CI/before_install.linux.sh; fi + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./CI/before_install.osx.sh; fi before_script: - - cd - - - mkdir build - - cd build - - cmake .. -DBUILD_WITH_CODE_COVERAGE=1 -DBUILD_UNITTESTS=1 -DCMAKE_INSTALL_PREFIX=/usr -DBINDIR=/usr/games -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_SYSTEM_TINYXML=TRUE + - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./CI/before_script.linux.sh; fi + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./CI/before_script.osx.sh; fi script: + - cd ./build - make -j4 after_script: - - ./openmw_test_suite + - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi notifications: recipients: - lgromanowski+travis.ci@gmail.com + - corrmage+travis-ci@gmail.com email: on_success: change on_failure: always diff --git a/CI/before_install.linux.sh b/CI/before_install.linux.sh new file mode 100755 index 000000000..998c285db --- /dev/null +++ b/CI/before_install.linux.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +export CXX=g++ +export CC=gcc + +echo "yes" | sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" +echo "yes" | sudo apt-add-repository ppa:openmw/openmw +sudo apt-get update -qq +sudo apt-get install -qq libgtest-dev google-mock +sudo apt-get install -qq libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libboost-wave-dev +sudo apt-get install -qq libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev +sudo apt-get install -qq libbullet-dev libogre-1.9-dev libmygui-dev libsdl2-dev libunshield-dev libtinyxml-dev libopenal-dev libqt4-dev +sudo mkdir /usr/src/gtest/build +cd /usr/src/gtest/build +sudo cmake .. -DBUILD_SHARED_LIBS=1 +sudo make -j4 +sudo ln -s /usr/src/gtest/build/libgtest.so /usr/lib/libgtest.so +sudo ln -s /usr/src/gtest/build/libgtest_main.so /usr/lib/libgtest_main.so diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh new file mode 100755 index 000000000..b1d4f991b --- /dev/null +++ b/CI/before_install.osx.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +export CXX=clang++ +export CC=clang + +brew tap openmw/openmw +brew update +brew unlink boost +brew install cmake openmw-mygui openmw-bullet openmw-sdl2 openmw-ffmpeg pkg-config qt unshield diff --git a/CI/before_script.linux.sh b/CI/before_script.linux.sh new file mode 100755 index 000000000..b4889c9e1 --- /dev/null +++ b/CI/before_script.linux.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir build +cd build +cmake .. -DBUILD_WITH_CODE_COVERAGE=1 -DBUILD_UNITTESTS=1 -DCMAKE_INSTALL_PREFIX=/usr -DBINDIR=/usr/games -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_SYSTEM_TINYXML=TRUE diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh new file mode 100755 index 000000000..772284f91 --- /dev/null +++ b/CI/before_script.osx.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir build +cd build +cmake -DCMAKE_FRAMEWORK_PATH="/usr/local/lib/macosx/Release" -DCMAKE_EXE_LINKER_FLAGS="-F/usr/local/lib/macosx/Release" -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" -DCMAKE_BUILD_TYPE=Debug -DBUILD_MYGUI_PLUGIN=OFF -G"Unix Makefiles" ..