1e4c94516SBruce B. Lacey####
2e4c94516SBruce B. Lacey#  Travis-CI configuration file for FreeCAD.
3e4c94516SBruce B. Lacey#
4e4c94516SBruce B. Lacey#  This build configuration will build and test FreeCAD on both Linux
5e4c94516SBruce B. Lacey#  and Mac OS X.  For Mac OS X, this configuration will also package
6e4c94516SBruce B. Lacey#  and deploy the build to GitHub provided the following prerequisites
7e4c94516SBruce B. Lacey#  are satisfied:
8e4c94516SBruce B. Lacey#
9e4c94516SBruce B. Lacey#  GH_TOKEN is defined as a secure environment variable and contains a
10e4c94516SBruce B. Lacey#           a valid GitHub OAUTH token with repo_deployment scope.
11e4c94516SBruce B. Lacey#           NOTE: Define this env using the Travis-CI Repo Settings UI
12e4c94516SBruce B. Lacey#
13e4c94516SBruce B. Lacey#  FREECAD_RELEASE: A GitHub Release with this identifier exists in the
14e4c94516SBruce B. Lacey#           repo.  The Travis job will deploy the OS X build to this
15e4c94516SBruce B. Lacey#           GitHub release name as a release asset.
166612e7c7SBruce Lacey#
176612e7c7SBruce Lacey#  DEPLOY: Repo setting to deploy (defaults to no deploy to reduce
186612e7c7SBruce Lacey#          Travis build times. Set DEPLOY=1 to enable in repo settings.
19e4c94516SBruce B. Lacey##
20e4c94516SBruce B. Laceyenv:
21e4c94516SBruce B. Lacey  global:
224b33a3e4Sabdullahtahiriyo    - GENERATOR="Unix Makefiles"
2391d84472Striplus    - CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
2491d84472Striplus#    - FREECAD_RELEASE="0.18"
2591d84472Striplus#    - DEPLOY_RELEASE=${DEPLOY_RELEASE:-$FREECAD_RELEASE}
2691d84472Striplus#    - OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
2791d84472Striplus#    - DEPLOY=${DEPLOY:-0}
2891d84472Striplus
2991d84472Striplus# jobs:
309e870becSYorik van Havre    # chunk.io key (if needed, obtain it with Yorik, PrzemoF, Kunda1)
3191d84472Striplus    # secure: MJu0ZU/9Yqut6bUkHoSrXTV/c/WhCLR0KnHKCsnEU081PYoukzH6ngzgKk7/trAH2In080d/ra4B2OmTNl/LAgV6DXKFY9dO1aG8QwcrHgaMPf0pHYUy/OfwQSFYFByQDV2OEMAHcIWc/dtNkzK2QUi44Kn7d0GtSEiN4s816lriWtjg0vmEGAU8MjvcAGss4gKyn05Xm1NUCYPKgpgIHsywLbpE76lv0eOYoosEuKv5Q9Pb4FMQts02+JUlqE8eY4ZZ3nV8iQbgIDdseOSA7Ixn05zWjU/ZRZ74TrYxMnzfUAwQcJe9OcqoESq+pPWQt5HYG66VmeVxQim1gmsiDASH51U/nswKt0Q4bISj3tVk0YZMFV8Ax+SzPvLEmFZJQGfgO1mg7HdNcz9N9G5JHPawrV19DwYIEFbAw8MCSAoIXFOcPQZUWXCbtjm7NO9vCjMrqyVJMDD9L8omvQajHoajuHbOT8KB250gFokeLj3z8yu++Tz+IrZX5inUMrXsARVt/ALXpi8rJPXmoFMpMUjyWmDPqPWlnqUhLtTtEtKpuOWP8ZnWVwkg4QYOUhCy95C1okJSGkG+ylHWncWfY4mS+UBT525laoh+GOhH+sRW+p2xkI21xGFRqg1oHjjgY1yIYF6nnSHPzxMBRYmZwagyXsjkFG5FPMWR2oYk0Yg
32ca94f64cSBruce B. Lacey
3391d84472Striplusgit:
3491d84472Striplus  depth: 5000
3591d84472Striplus
3691d84472Striplusnotifications:
3791d84472Striplus  email: false
3891d84472Striplus  webhooks:
3991d84472Striplus    urls:
4091d84472Striplus      - https://webhooks.gitter.im/e/479456663cdf5c84e4d8
4191d84472Striplus    on_success: always
4291d84472Striplus    on_failure: always
4391d84472Striplus    on_start:   change
442d07db45SBruce B. Lacey
452707ea9aSBruce B. Lacey# Inject osx build into matrix - needed to specify image/dist
46a199adcdStriplusjobs:
4791d84472Striplus#    allow_failures:
4891d84472Striplus#      - python: 3.7
49cf5a0457Scclauss    fast_finish: true  # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
502707ea9aSBruce B. Lacey    include:
515084b967SBruce B. Lacey      - os: linux
5217ce36b0Striplus        dist: bionic
5391d84472Striplus        language: cpp
545084b967SBruce B. Lacey        compiler: clang
5591d84472Striplus        cache: ccache
56fab86e6dStriplus        addons:
57fab86e6dStriplus          apt:
58fab86e6dStriplus            sources:
59fab86e6dStriplus              - sourceline: 'ppa:ubuntu-toolchain-r/test'
60fab86e6dStriplus              - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
61fab86e6dStriplus                key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
62fab86e6dStriplus            packages:
63fab86e6dStriplus              - clang-9
6417ce36b0Striplus        env:
65fab86e6dStriplus          - CC=clang-9
66fab86e6dStriplus          - CXX=clang++-9
6791d84472Striplus          - CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
68d2bcb7beStriplus          - CACHE_NAME=JOB1
69a6894034Slooooo
70a6894034Slooooo      - os: linux
7117ce36b0Striplus        dist: bionic
7291d84472Striplus        language: cpp
7391d84472Striplus        compiler: gcc-9
7491d84472Striplus        cache: ccache
7591d84472Striplus        addons:
7691d84472Striplus          apt:
7791d84472Striplus            sources:
7891d84472Striplus              - sourceline: 'ppa:ubuntu-toolchain-r/test'
7991d84472Striplus            packages:
8091d84472Striplus              - gcc-9
8191d84472Striplus              - g++-9
82a6894034Slooooo        env:
8391d84472Striplus          - CC=gcc-9
8491d84472Striplus          - CXX=g++-9
8591d84472Striplus          - CC_FOR_BUILD=gcc-9
8691d84472Striplus          - CXX_FOR_BUILD=g++-9
8791d84472Striplus          - CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
8891d84472Striplus          - CACHE_NAME=JOB2
89a6894034Slooooo
905084b967SBruce B. Lacey      - os: linux
9117ce36b0Striplus        dist: bionic
9291d84472Striplus        language: cpp
9391d84472Striplus        compiler: gcc-7
9491d84472Striplus        cache: ccache
9591d84472Striplus        env:
9691d84472Striplus          - CC=gcc-7
9791d84472Striplus          - CXX=g++-7
9891d84472Striplus          - CC_FOR_BUILD=gcc-7
9991d84472Striplus          - CXX_FOR_BUILD=g++-7
10091d84472Striplus          - CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc"
10191d84472Striplus          - CACHE_NAME=JOB3
102b7ccf8daScclauss
1034b33a3e4Sabdullahtahiriyo      - os: windows
1044b33a3e4Sabdullahtahiriyo        language: cpp
1054b33a3e4Sabdullahtahiriyo        env:
1064b33a3e4Sabdullahtahiriyo          - CMAKE_OPTS="-DBUILD_FEM_NETGEN=ON -DFREECAD_RELEASE_PDB=OFF"
1074b33a3e4Sabdullahtahiriyo          - GENERATOR="Visual Studio 15 2017 Win64"
108a199adcdStriplus          - PYTHON_MAJOR_VERSION=3
1094b33a3e4Sabdullahtahiriyo          - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
1104b33a3e4Sabdullahtahiriyo          - TEST_PATH="C:\Users\travis\build\FreeCAD\FreeCAD\build\bin"
111a199adcdStriplus          - CLCACHE_PATH="C:\Users\travis\build\FreeCAD\FreeCAD"
1124b33a3e4Sabdullahtahiriyo          - VS15=true
1134b33a3e4Sabdullahtahiriyo          - CCACHE_TEMPDIR=/tmp/.ccache-temp
1144b33a3e4Sabdullahtahiriyo          - CCACHE_COMPRESS=1
1154b33a3e4Sabdullahtahiriyo          - CCACHE_DIR=$HOME/.ccache
116d2bcb7beStriplus          - CACHE_NAME=JOB5
1174b33a3e4Sabdullahtahiriyo          # enable this if clcache extended log is needed
1187e25a423SAbdullah Tahiri          #- CLCACHE_LOG=1
1194b33a3e4Sabdullahtahiriyo        cache:
1204b33a3e4Sabdullahtahiriyo          directories:
1214b33a3e4Sabdullahtahiriyo            - $HOME/clcache
1224b33a3e4Sabdullahtahiriyo
123e31f84f5Ssgrogan#      - language: python
124e31f84f5Ssgrogan#        python: 3.7
125e31f84f5Ssgrogan#        dist: xenial  # required for Python >= 3.7 (travis-ci/travis-ci#9069)
126e31f84f5Ssgrogan#        before_install: true
127e31f84f5Ssgrogan#        install: python3 -m pip install flake8
128e31f84f5Ssgrogan#        # fail the build if there are Python syntax errors or undefined names
129e31f84f5Ssgrogan#        script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
130a6894034Slooooo
13176ce101aSYorik van Havre
132dff298c5SPrzemo Firsztbefore_install:
13391d84472Striplus# - eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
134e4c94516SBruce B. Lacey- |
135e4c94516SBruce B. Lacey  case "${TRAVIS_OS_NAME}" in
136e4c94516SBruce B. Lacey
137e4c94516SBruce B. Lacey   "linux")
13817ce36b0Striplus       # Daily PPA for OCCT, Pivy, Netgen, PySide ... packages
13917ce36b0Striplus       sudo apt-add-repository -y ppa:freecad-maintainers/freecad-daily 
140e4c94516SBruce B. Lacey       sudo apt-get update -qq
14117ce36b0Striplus       # Build deps
142ee3456fdSPriit Laes       sudo apt-get install -y --no-install-recommends          \
1430eaf34ceSBruce B. Lacey                               python-dev                       \
1440eaf34ceSBruce B. Lacey                               python-pyside                    \
1450eaf34ceSBruce B. Lacey                               python-matplotlib                \
146a6894034Slooooo                               python3-dev                      \
147a6894034Slooooo                               python3-pyside                   \
148a6894034Slooooo                               python3-matplotlib               \
14917ce36b0Striplus                               libboost1.65-dev                 \
15017ce36b0Striplus                               libboost-filesystem1.65-dev      \
15117ce36b0Striplus                               libboost-program-options1.65-dev \
15217ce36b0Striplus                               libboost-python1.65-dev          \
15317ce36b0Striplus                               libboost-regex1.65-dev           \
15417ce36b0Striplus                               libboost-signals1.65-dev         \
15517ce36b0Striplus                               libboost-system1.65-dev          \
15617ce36b0Striplus                               libboost-thread1.65-dev          \
15717ce36b0Striplus                               libxerces-c-dev                  \
15817ce36b0Striplus                               libocct-data-exchange-dev        \
15917ce36b0Striplus                               libocct-ocaf-dev                 \
16017ce36b0Striplus                               libocct-visualization-dev        \
16117ce36b0Striplus                               libvtk7-dev                      \
16217ce36b0Striplus                               libmedc-dev                      \
1633d7b6b35Ssgrogan                               pybind11-dev                     \
16417ce36b0Striplus                               swig                             \
1650eaf34ceSBruce B. Lacey                               qt4-qmake                        \
166f2127c37Swmayer                               libqt4-opengl-dev                \
16717ce36b0Striplus                               libqtwebkit-dev                  \
16817ce36b0Striplus                               qtbase5-dev                      \
16917ce36b0Striplus                               libqt5xmlpatterns5-dev           \
17017ce36b0Striplus                               libqt5svg5-dev                   \
17117ce36b0Striplus                               libqt5opengl5-dev                \
17217ce36b0Striplus                               qttools5-dev                     \
17317ce36b0Striplus                               qtwebengine5-dev                 \
17417ce36b0Striplus                               libcoin80-dev                    \
17517ce36b0Striplus                               libpyside-dev                    \
17617ce36b0Striplus                               libpyside2-dev                   \
17717ce36b0Striplus                               libshiboken-dev                  \
17817ce36b0Striplus                               libshiboken2-dev                 \
17917ce36b0Striplus                               pyside-tools                     \
18017ce36b0Striplus                               pyside2-tools                    \
18117ce36b0Striplus                               doxygen                          \
18217ce36b0Striplus                               graphviz                         \
1833d7b6b35Ssgrogan                               libnglib-dev                     \
184cbe161b4Swmayer                               netgen                           \
18517ce36b0Striplus                               netgen-headers                   \
18617ce36b0Striplus                               libmetis-dev                     \
18717ce36b0Striplus                               libspnav-dev
188c5ac5e0eStriplus       # Runtime deps
189a2a59b88Striplus       sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-ply python3-ply
1906844e7edSBruce B. Lacey
191e4c94516SBruce B. Lacey       export DISPLAY=:99.0
192e4c94516SBruce B. Lacey       sh -e /etc/init.d/xvfb start
193e4c94516SBruce B. Lacey
194ca94f64cSBruce B. Lacey       export INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
19591d84472Striplus       export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/netgen/:$LD_LIRBARY_PATH
196e4c94516SBruce B. Lacey       ;;
197e4c94516SBruce B. Lacey
198e4c94516SBruce B. Lacey   "osx")
19991d84472Striplus       #xcodebuild -version -sdk
20091d84472Striplus       #brew --config
20191d84472Striplus       #if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
20291d84472Striplus       #     brew install jq
20391d84472Striplus       #     cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
20491d84472Striplus       #     travis_wait prime_local_ports_cache $cacheContext
20591d84472Striplus       #fi
20691d84472Striplus       #brew update >/dev/null
20791d84472Striplus       #brew --config
2082707ea9aSBruce B. Lacey
20991d84472Striplus       #brew tap FreeCAD/freecad
2108f5c7b44SBruce Lacey
21191d84472Striplus       #brew install --verbose --only-dependencies freecad --with-packaging-utils
21291d84472Striplus       #pip install six
21391d84472Striplus       ## Qt5:  Set Qt5 build flag and CMAKE_PREFIX
21491d84472Striplus       #QT5_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qt/*/lib/cmake)
21591d84472Striplus       #QT5_WEBKIT_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qtwebkit/*/lib/cmake)
21691d84472Striplus       #CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_QT5=ON -DCMAKE_PREFIX_PATH=${QT5_CMAKE_PREFIX};${QT5_WEBKIT_CMAKE_PREFIX}"
217e4c94516SBruce B. Lacey
21891d84472Striplus       ##Install the 3DConnexion frameworks
21991d84472Striplus       #if [ "${DEPLOY}" == "1" ]; then
22091d84472Striplus       #   if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
22191d84472Striplus       #      curl -o /tmp/3dFW.dmg -L 'http://www.3dconnexion.com/index.php?eID=sdl&ext=tx_iccsoftware&oid=a273bdbc-c289-e10d-816b-567043331c9e&filename=3DxWareMac_v10-4-1_r2428.dmg'
22291d84472Striplus       #      hdiutil attach -readonly /tmp/3dFW.dmg
22391d84472Striplus       #      sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
22491d84472Striplus       #      diskutil eject /Volumes/3Dconnexion\ Software
22591d84472Striplus       #   fi
22691d84472Striplus       #   export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=ON"
22791d84472Striplus       #   export INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/MacOS/FreeCAD"
22891d84472Striplus       #else
22991d84472Striplus       #   export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
23091d84472Striplus       #fi
231e4c94516SBruce B. Lacey
23291d84472Striplus       #export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
233e4c94516SBruce B. Lacey       ;;
234e4c94516SBruce B. Lacey
2354b33a3e4Sabdullahtahiriyo   "windows")
2364b33a3e4Sabdullahtahiriyo       #choco install -y python
2374b33a3e4Sabdullahtahiriyo       #py -m pip install --quiet --upgrade pip
2384b33a3e4Sabdullahtahiriyo       #py -m pip install git+https://github.com/frerich/clcache.git@v4.2.0
2394b33a3e4Sabdullahtahiriyo       curl -L https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip --output clcache-4.2.0.zip
2404b33a3e4Sabdullahtahiriyo       7z x clcache-4.2.0.zip > /dev/null
2414b33a3e4Sabdullahtahiriyo       export PATH=$CLCACHE_PATH:$PATH
242da4946d3Sabdullahtahiriyo       export PATH=$TEST_PATH:$PATH
2434b33a3e4Sabdullahtahiriyo       #reset clcache hit stats
244a199adcdStriplus       cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -z'
2454b33a3e4Sabdullahtahiriyo       # clcache stats before compilation
246a199adcdStriplus       cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
2474b33a3e4Sabdullahtahiriyo
2483089ffd4Ssgrogan       curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19_pre/FreeCADLibs_12.1.4_x64_VC15.7z --output FreeCADLibs.7z
2494b33a3e4Sabdullahtahiriyo       7z x FreeCADLibs.7z -oFreeCADLibs > /dev/null
250a801ff5aStriplus       rm -f FreeCADLibs.7z
251a199adcdStriplus       export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15"
2524b33a3e4Sabdullahtahiriyo
253a199adcdStriplus       export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_LIBPACK_DIR=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15 -DPYTHON_EXECUTABLE=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15\bin\python.exe \
2544b33a3e4Sabdullahtahiriyo       -DBUILD_QT5=TRUE"
2554b33a3e4Sabdullahtahiriyo       export PATH=$MSBUILD_PATH:$PATH
2564b33a3e4Sabdullahtahiriyo       ;;
2574b33a3e4Sabdullahtahiriyo
258e4c94516SBruce B. Lacey   *)
259e4c94516SBruce B. Lacey       echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
260e4c94516SBruce B. Lacey       exit 1
261e4c94516SBruce B. Lacey       ;;
262e4c94516SBruce B. Lacey  esac
263dff298c5SPrzemo Firszt
264dff298c5SPrzemo Firsztinstall:
265e4c94516SBruce B. Lacey####
266e4c94516SBruce B. Lacey#  Build FreeCAD with cmake options set above for each platform
267e4c94516SBruce B. Lacey##
2684b33a3e4Sabdullahtahiriyo  - mkdir build && cd build && cmake -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
269dff298c5SPrzemo Firszt
270dff298c5SPrzemo Firsztscript:
271e4c94516SBruce B. Lacey####
272e4c94516SBruce B. Lacey#  Install FreeCAD and run unit tests.  Test failures will fail the build
273e4c94516SBruce B. Lacey##
274ab23ac4fSMarkus Reitboeck#        MSBuild.exe /m FreeCAD.sln
2754b33a3e4Sabdullahtahiriyo  - |
2764b33a3e4Sabdullahtahiriyo    if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
277a199adcdStriplus        # https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/6
2784b33a3e4Sabdullahtahiriyo        # call msbuild using clcache 
279a199adcdStriplus        #cmd.exe //C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 && MSBuild.exe FreeCAD.sln /p:CLToolExe=clcache.exe /p:TrackFileAccess=false /p:CLToolPath=C:\Users\travis\build\FreeCAD\FreeCAD /m:2 /nologo /verbosity:minimal /p:Configuration=Release /p:Platform=x64'
280a199adcdStriplus        cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
2814b33a3e4Sabdullahtahiriyo        # ls -lahR
282a199adcdStriplus        mkdir bin/
283a199adcdStriplus        mv ../FreeCADLibs/FreeCADLibs_12.1.4_x64_VC15/bin/* bin/
284ffe01736Striplus        du -hs bin/
2854b33a3e4Sabdullahtahiriyo        # show clcache hit stats
286a199adcdStriplus        cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
2874b33a3e4Sabdullahtahiriyo        # run the tests
288a199adcdStriplus        #cmd.exe //C 'cd C:\Users\travis\build\FreeCAD\FreeCAD\build\bin && FreeCADCmd.exe --run-test 0'
289da4946d3Sabdullahtahiriyo        # Make build fail if ANY of the following fails
290bd8fc552SAbdullah Tahiri        #set -ev 
291da4946d3Sabdullahtahiriyo        winpty.exe -Xallow-non-tty -Xplain /C/Users/travis/build/FreeCAD/FreeCAD/build/bin/FreeCADCmd.exe --run-test 0 | tee runlog.txt
292bd8fc552SAbdullah Tahiri        grep -q FAILED runlog.txt ; [ $? == 1 ] && echo "Build succeeded and tests passed!" || ( echo "Tests failed!" && false )
2934b33a3e4Sabdullahtahiriyo    else
29437ca8cb3Striplus        # Stop compiling (GCC) after 2 hrs 50 min (3 hrs limit).
29517ce36b0Striplus        # Preserves created ccache for the next build job.
29691d84472Striplus        # if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
29791d84472Striplus        # if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo make -j2 install; fi
29891d84472Striplus        cat $HOME/.ccache/ccache.conf
29991d84472Striplus        ccache -z -s
30091d84472Striplus        sudo make -j2 install
30191d84472Striplus        ccache -s
30284752715Striplus        ${INSTALLED_APP_PATH} --console --run-test 0 || travis_terminate 1
3034b33a3e4Sabdullahtahiriyo        ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
3044b33a3e4Sabdullahtahiriyo        sleep 10 && pkill FreeCAD
3054b33a3e4Sabdullahtahiriyo        cat /tmp/FreeCAD_installed.log
3064b33a3e4Sabdullahtahiriyo        grep --file=../.log_errors /tmp/FreeCAD_installed.log ; [ $? == 1 ] && echo "No errors from .log_errors file found in the log after start from /usr/local/bin" || ( echo "Error from .log_errors found!" && false )
3074b33a3e4Sabdullahtahiriyo    fi
308140272b9SPrzemo Firszt
30991d84472Striplus#after_success:
310e4c94516SBruce B. Lacey#  Package and deploy the build to GitHub.  This will only run for builds on
311e4c94516SBruce B. Lacey#  master (i.e. pull requests are only built and tested but not deployed).
312e4c94516SBruce B. Lacey#
313e4c94516SBruce B. Lacey#  GH_TOKEN must be set in order to deploy releases to GitHub
31491d84472Striplus#
31591d84472Striplus#- |
31691d84472Striplus#  if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" -a "${DEPLOY}" == "1" ]; then
31791d84472Striplus#     brew ls --versions jq || brew install jq
31891d84472Striplus#     npm install -g appdmg
31991d84472Striplus#     export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h)
32091d84472Striplus#     export DEPLOYMENT_ARCHIVE=${VSN}-${QT}.dmg
32191d84472Striplus#     appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
32291d84472Striplus#     deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
32391d84472Striplus#     gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
32491d84472Striplus#     gitHub_prune_assets_for_release_named $deployContext "-${QT}" 1
32591d84472Striplus#  fi
32691d84472Striplus
327