.travis.yml
changeset 11748 4a68030ee852
parent 11662 97a4188fc99e
child 11749 5d66eace5b81
equal deleted inserted replaced
11747:3182ee5be2b0 11748:4a68030ee852
     1 language: c
     1 language: c
       
     2 sudo: false
     2 os:
     3 os:
     3   - linux
     4   - linux
     4   - osx
     5   - osx
       
     6 
     5 branches:
     7 branches:
     6   only:
     8   only:
     7     master
     9     master
       
    10 
     8 compiler:
    11 compiler:
     9   - gcc
    12   - gcc
    10   - clang
    13   - clang
       
    14 
    11 env:
    15 env:
    12   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Release"
    16   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Release"
    13   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
    17   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
    14   - BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1"
    18   - BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1"
    15   - BUILD_ARGS="-DNOSERVER=1 -DNOVIDEOREC=1 -DNOPNG=1"
    19   - BUILD_ARGS="-DNOSERVER=1 -DNOVIDEOREC=1 -DNOPNG=1"
    16   - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0 -DPHYSFS_SYSTEM=0"
    20   - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0 -DPHYSFS_SYSTEM=0"
       
    21 
    17 matrix:
    22 matrix:
    18   include:
    23   include:
    19   - language: objective-c
    24   - language: objective-c
       
    25     sudo: required
    20     os: osx
    26     os: osx
    21     compiler:
    27     compiler: clang
    22     env: BUILD_ARGS="IOS" SDL_LIB_PATH="$TRAVIS_BUILD_DIR/../Library"
    28     env: TRAVIS_OS_NAME="ios" SDL_LIB_PATH="$TRAVIS_BUILD_DIR/../Library"
    23     osx_image: xcode7.2
    29     osx_image: xcode7.2
    24     sudo: required
    30 
    25 before_install: |
    31 before_install: |
    26   if [ "$BUILD_ARGS" == "IOS" ]; then
    32   if [ "$TRAVIS_OS_NAME" == "linux" ]; then
       
    33     sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
       
    34     sudo apt-get update -qq
       
    35   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
       
    36     brew update --all
       
    37   elif [ "$TRAVIS_OS_NAME" == "ios" ]; then
    27     hg clone http://hg.libsdl.org/SDL $SDL_LIB_PATH/SDL/
    38     hg clone http://hg.libsdl.org/SDL $SDL_LIB_PATH/SDL/
    28     hg clone http://hg.libsdl.org/SDL_image $SDL_LIB_PATH/SDL_image/
    39     hg clone http://hg.libsdl.org/SDL_image $SDL_LIB_PATH/SDL_image/
    29     hg clone http://hg.libsdl.org/SDL_net $SDL_LIB_PATH/SDL_net/
    40     hg clone http://hg.libsdl.org/SDL_net $SDL_LIB_PATH/SDL_net/
    30     hg clone http://hg.libsdl.org/SDL_ttf $SDL_LIB_PATH/SDL_ttf/
    41     hg clone http://hg.libsdl.org/SDL_ttf $SDL_LIB_PATH/SDL_ttf/
    31     hg clone http://hg.libsdl.org/SDL_mixer $SDL_LIB_PATH/SDL_mixer/
    42     hg clone http://hg.libsdl.org/SDL_mixer $SDL_LIB_PATH/SDL_mixer/
    32   elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
       
    33     sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
       
    34     sudo apt-get update -qq
       
    35   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
       
    36     brew update --all
       
    37   fi
    43   fi
       
    44 
    38 install: |
    45 install: |
    39   if [ "$BUILD_ARGS" == "IOS" ]; then
    46   if [ "$TRAVIS_OS_NAME" == "linux" ]; then
    40     # FPC 3.0.0 required for using FPC 3.0.1 which contains rtl for ios
       
    41     sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.0.intel-macosx.dmg
       
    42     sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.1.intel-macosx.cross.ios.dmg
       
    43   elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
       
    44     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
    47     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
    45   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
    48   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
    46     brew install fpc glew qt physfs lua51 sdl2 sdl2_image sdl2_net sdl2_ttf ffmpeg ghc cabal-install
    49     brew install fpc glew qt physfs lua51 sdl2 sdl2_image sdl2_net sdl2_ttf ffmpeg ghc cabal-install
    47     brew install sdl2_mixer --with-libvorbis
    50     brew install sdl2_mixer --with-libvorbis
    48     # use cabal install haskell deps, pas2c ones are covered by server
    51     # use cabal install haskell deps, pas2c ones are covered by server
    53     if [[ "$BUILD_ARGS" == *"BUILD_ENGINE_C"* ]]; then
    56     if [[ "$BUILD_ARGS" == *"BUILD_ENGINE_C"* ]]; then
    54       cabal update
    57       cabal update
    55       cabal install --only-dependencies tools/pas2c/pas2c.cabal
    58       cabal install --only-dependencies tools/pas2c/pas2c.cabal
    56     fi
    59     fi
    57     # avoid installing Sparkle, add default unit path
    60     # avoid installing Sparkle, add default unit path
    58     export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1 -DCMAKE_Pascal_FLAGS=-Fu/usr/local/lib/fpc/$(fpc -iW)/units/x86_64-darwin/*/"
    61     export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1"
       
    62   elif [ "$TRAVIS_OS_NAME" == "ios" ]; then
       
    63     # FPC 3.0.0 required for using FPC 3.0.1 which contains rtl for ios
       
    64     sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.0.intel-macosx.dmg
       
    65     sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.1.intel-macosx.cross.ios.dmg
    59   fi
    66   fi
       
    67 
    60 before_script: |
    68 before_script: |
    61   if [ "$BUILD_ARGS" == "IOS" ]; then
    69   if [ "$TRAVIS_OS_NAME" == "ios" ]; then
    62     # More or less stable hw iOS version can be compiled with FPC 3.1.1, btw there are no (easy?) way to build it from sources,
    70     # More or less stable hw iOS version can be compiled with FPC 3.1.1,
       
    71     # but there are no (easy?) way to build it from sources,
    63     # so we just temporary switch Xcode project to use FPC 3.0.1
    72     # so we just temporary switch Xcode project to use FPC 3.0.1
    64     git apply tools/fix_fpc_ios_build_patch.diff
    73     git apply tools/fix_fpc_ios_build_patch.diff
    65     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme UpdateDataFolder build
    74     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme UpdateDataFolder build
    66   else
    75   else
    67     mkdir build && cd build && cmake $BUILD_ARGS ..
    76     mkdir build && cd build && cmake $BUILD_ARGS ..
    68   fi
    77   fi
       
    78 
    69 script: |
    79 script: |
    70   if [ "$BUILD_ARGS" == "IOS" ]; then
    80   if [ "$TRAVIS_OS_NAME" == "ios" ]; then
    71     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme Hedgewars -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
    81     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme Hedgewars -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
    72   else
    82   else
    73     make VERBOSE=1
    83     make VERBOSE=1
    74   fi
    84   fi
       
    85 
    75 after_success: |
    86 after_success: |
    76   if [ "$BUILD_ARGS" == "IOS" ]; then
    87   if [ "$TRAVIS_OS_NAME" == "linux" ]; then
    77     :
       
    78   elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
       
    79     make test_verbose
    88     make test_verbose
    80   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
    89   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
    81     make install
    90     make install
    82   fi
    91   fi
       
    92 
    83 notifications:
    93 notifications:
    84   email: false
    94   email: false
    85   irc:
    95   irc:
    86     channels:
    96     channels:
    87       - "chat.freenode.net#hedgewars"
    97       - "chat.freenode.net#hedgewars"