File: .travis.yml

package info (click to toggle)
fifechan 0.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 2,520 kB
  • sloc: cpp: 21,438; makefile: 11
file content (92 lines) | stat: -rw-r--r-- 3,812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
language: cpp

compiler: clang

os:
  - linux
  - osx

dist: xenial

git:
  depth: 5

addons:
    apt:
      sources:
        #- llvm-toolchain-xenial-7
      packages:
        # 7z is used for packaging (see before_deploy)
        - p7zip-full 
        - mesa-common-dev
        - libsdl2-dev
        - libsdl2-image-dev
        - libsdl2-ttf-dev
        - libfreetype6-dev
        #- clang-7.0
        #- llvm-7.0-dev
        #- libclang-7.0-dev

before_install:
  # change clang to version 5.0
  #- if [ $TRAVIS_OS_NAME == linux ]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 20; sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 20; fi
  #- if [ $TRAVIS_OS_NAME == linux ]; then sudo rm -f /usr/local/clang-3.9.0/bin/clang; sudo rm -f /usr/local/clang-3.9.0/bin/clang++; sudo update-alternatives --config clang; sudo update-alternatives --config clang++; fi

  - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get -qq update && sudo apt-get install -y libgle3-dev cppcheck; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install sdl2 sdl2_image sdl2_ttf freetype; fi
  # build OGLFT
  - if [ $TRAVIS_OS_NAME == osx ]; then svn checkout https://svn.code.sf.net/p/oglft/code/trunk oglft-code; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then cd oglft-code; fi
  # Patch CMakeLists.txt dont load shipped CMake Modul to load FreeType, its provided by CMake and able to find FreeType.
  - if [ $TRAVIS_OS_NAME == osx ]; then sed -i.bak '4d' CMakeLists.txt; fi
  # Also include Freetype
  - if [ $TRAVIS_OS_NAME == osx ]; then sed -i.bak -e '6a\'$'\n''if(FREETYPE_FOUND)' CMakeLists.txt; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then sed -i.bak -e '7a\'$'\n''INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})' CMakeLists.txt; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then sed -i.bak -e '8a\'$'\n''endif(FREETYPE_FOUND)' CMakeLists.txt; fi
  # configure oglft - install into /usr folder
  - if [ $TRAVIS_OS_NAME == osx ]; then cmake -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX=/usr/local . ; fi
  # make oglft
  - if [ $TRAVIS_OS_NAME == osx ]; then make -j3; fi
  # install oglft
  - if [ $TRAVIS_OS_NAME == osx ]; then sudo make install; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then cd ..; fi
   
script:
  # create folder for an out-of-source-tree build
  - mkdir _build
  # switch to build folder
  - cd _build
  # call cmake to configure the build env
  - if [ $TRAVIS_OS_NAME == linux ]; then cmake -DCMAKE_INSTALL_PREFIX=/fifechan ..; fi
  - if [ $TRAVIS_OS_NAME == osx ]; then cmake -DENABLE_SDL_CONTRIB=ON -DENABLE_OPENGL_CONTRIB=ON -DCMAKE_INSTALL_PREFIX=/fifechan ..; fi
  # finally, make
  - make -j3 VERBOSE=1
  # then install
  - sudo make install

after_script: 
   # run cppcheck only on Linux
   - if [ $TRAVIS_OS_NAME == linux ]; then cd /home/travis/build/fifengine/fifechan; fi
   - if [ $TRAVIS_OS_NAME == linux ]; then cppcheck --verbose --enable=all --std=posix --std=c++11 --quiet -I include src; fi

before_deploy:
  - sudo ls -alh /fifechan/*
  # let's package for Linux
  - if [ $TRAVIS_OS_NAME == linux ]; then 7z a -ttar -so fifechan.tar /fifechan/* | 7z a -si fifechan-$TRAVIS_TAG.tar.gz; fi
  # let's package for Mac
  - if [ $TRAVIS_OS_NAME == osx ]; then 7z a -ttar -so fifechan.tar /fifechan/* | 7z a -si fifechan-mac-$TRAVIS_TAG.tar.gz; fi

deploy:
  provider: releases
  api_key: 
    secure: "pWuM+6g5NjLo0mIyanHpNSWgs8f99fAqWb8ttY3YGNkiKWPmtTMZxktGdONp3dIOYykK8fHuCX2fuXNGhfv3wYllNAqbHgZ2Z6718q57xbjIplvJwdJ1+iAmmMGs1UDNyNLlMVr9y+hXzJLfIhd5/mp4+Wb3JqSDXtk+9ScV2JE="
  file: fifechan*.tar.gz          # wildcard for "fifechan-1.2.3.tar.gz" and "fifechan-mac-1.2.3.tar.gz"
  file_glob: true
  skip_cleanup: true
  overwrite: true
  on:
    tags: true

notifications:
  irc: irc.freenode.org#fife
  email: false