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:
519f3bb051Striplus      - if: type != pull_request
529f3bb051Striplus        os: linux
5317ce36b0Striplus        dist: bionic
5491d84472Striplus        language: cpp
555084b967SBruce B. Lacey        compiler: clang
5691d84472Striplus        cache: ccache
57fab86e6dStriplus        addons:
58fab86e6dStriplus          apt:
59fab86e6dStriplus            sources:
60fab86e6dStriplus              - sourceline: 'ppa:ubuntu-toolchain-r/test'
61c17d5ae3Striplus              - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
62fab86e6dStriplus                key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
63fab86e6dStriplus            packages:
64c17d5ae3Striplus              - clang-10
6517ce36b0Striplus        env:
66c17d5ae3Striplus          - CC=clang-10
67c17d5ae3Striplus          - CXX=clang++-10
68d4ea5b89Striplus          - CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
69d2bcb7beStriplus          - CACHE_NAME=JOB1
70a6894034Slooooo
71a6894034Slooooo      - os: linux
7217ce36b0Striplus        dist: bionic
7391d84472Striplus        language: cpp
74c17d5ae3Striplus        compiler: gcc-10
7591d84472Striplus        cache: ccache
7691d84472Striplus        addons:
7791d84472Striplus          apt:
7891d84472Striplus            sources:
7991d84472Striplus              - sourceline: 'ppa:ubuntu-toolchain-r/test'
8091d84472Striplus            packages:
81c17d5ae3Striplus              - gcc-10
82c17d5ae3Striplus              - g++-10
83a6894034Slooooo        env:
84c17d5ae3Striplus          - CC=gcc-10
85c17d5ae3Striplus          - CXX=g++-10
86c17d5ae3Striplus          - CC_FOR_BUILD=gcc-10
87c17d5ae3Striplus          - CXX_FOR_BUILD=g++-10
8891d84472Striplus          - 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"
8991d84472Striplus          - CACHE_NAME=JOB2
90a6894034Slooooo
915084b967SBruce B. Lacey      - os: linux
9217ce36b0Striplus        dist: bionic
9391d84472Striplus        language: cpp
9491d84472Striplus        compiler: gcc-7
9591d84472Striplus        cache: ccache
9691d84472Striplus        env:
9791d84472Striplus          - CC=gcc-7
9891d84472Striplus          - CXX=g++-7
9991d84472Striplus          - CC_FOR_BUILD=gcc-7
10091d84472Striplus          - CXX_FOR_BUILD=g++-7
10191d84472Striplus          - CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc"
10291d84472Striplus          - CACHE_NAME=JOB3
103b7ccf8daScclauss
1044b33a3e4Sabdullahtahiriyo      - os: windows
1054b33a3e4Sabdullahtahiriyo        language: cpp
1064b33a3e4Sabdullahtahiriyo        env:
10762808e95Ssgrogan          - CMAKE_OPTS="-DBUILD_FEM_NETGEN=ON -DFREECAD_RELEASE_PDB=OFF -DFREECAD_RELEASE_SEH=OFF"
1084b33a3e4Sabdullahtahiriyo          - GENERATOR="Visual Studio 15 2017 Win64"
109a199adcdStriplus          - PYTHON_MAJOR_VERSION=3
1104b33a3e4Sabdullahtahiriyo          - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
1114b33a3e4Sabdullahtahiriyo          - TEST_PATH="C:\Users\travis\build\FreeCAD\FreeCAD\build\bin"
112a199adcdStriplus          - CLCACHE_PATH="C:\Users\travis\build\FreeCAD\FreeCAD"
1134b33a3e4Sabdullahtahiriyo          - VS15=true
1144b33a3e4Sabdullahtahiriyo          - CCACHE_TEMPDIR=/tmp/.ccache-temp
1154b33a3e4Sabdullahtahiriyo          - CCACHE_COMPRESS=1
1164b33a3e4Sabdullahtahiriyo          - CCACHE_DIR=$HOME/.ccache
117d2bcb7beStriplus          - CACHE_NAME=JOB5
1184b33a3e4Sabdullahtahiriyo          # enable this if clcache extended log is needed
1197e25a423SAbdullah Tahiri          #- CLCACHE_LOG=1
1204b33a3e4Sabdullahtahiriyo        cache:
1214b33a3e4Sabdullahtahiriyo          directories:
1224b33a3e4Sabdullahtahiriyo            - $HOME/clcache
1234b33a3e4Sabdullahtahiriyo
124e31f84f5Ssgrogan#      - language: python
125e31f84f5Ssgrogan#        python: 3.7
126e31f84f5Ssgrogan#        dist: xenial  # required for Python >= 3.7 (travis-ci/travis-ci#9069)
127e31f84f5Ssgrogan#        before_install: true
128e31f84f5Ssgrogan#        install: python3 -m pip install flake8
129e31f84f5Ssgrogan#        # fail the build if there are Python syntax errors or undefined names
130e31f84f5Ssgrogan#        script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
131a6894034Slooooo
13276ce101aSYorik van Havre
133dff298c5SPrzemo Firsztbefore_install:
13491d84472Striplus# - eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
135e4c94516SBruce B. Lacey- |
136e4c94516SBruce B. Lacey  case "${TRAVIS_OS_NAME}" in
137e4c94516SBruce B. Lacey
138e4c94516SBruce B. Lacey   "linux")
13917ce36b0Striplus       # Daily PPA for OCCT, Pivy, Netgen, PySide ... packages
14017ce36b0Striplus       sudo apt-add-repository -y ppa:freecad-maintainers/freecad-daily 
141e4c94516SBruce B. Lacey       sudo apt-get update -qq
14217ce36b0Striplus       # Build deps
143ee3456fdSPriit Laes       sudo apt-get install -y --no-install-recommends          \
1440eaf34ceSBruce B. Lacey                               python-dev                       \
1450eaf34ceSBruce B. Lacey                               python-pyside                    \
1460eaf34ceSBruce B. Lacey                               python-matplotlib                \
147a6894034Slooooo                               python3-dev                      \
148a6894034Slooooo                               python3-pyside                   \
149a6894034Slooooo                               python3-matplotlib               \
15017ce36b0Striplus                               libboost1.65-dev                 \
15117ce36b0Striplus                               libboost-filesystem1.65-dev      \
15217ce36b0Striplus                               libboost-program-options1.65-dev \
15317ce36b0Striplus                               libboost-python1.65-dev          \
15417ce36b0Striplus                               libboost-regex1.65-dev           \
15517ce36b0Striplus                               libboost-signals1.65-dev         \
15617ce36b0Striplus                               libboost-system1.65-dev          \
15717ce36b0Striplus                               libboost-thread1.65-dev          \
15817ce36b0Striplus                               libxerces-c-dev                  \
15917ce36b0Striplus                               libocct-data-exchange-dev        \
16017ce36b0Striplus                               libocct-ocaf-dev                 \
16117ce36b0Striplus                               libocct-visualization-dev        \
16217ce36b0Striplus                               libvtk7-dev                      \
16317ce36b0Striplus                               libmedc-dev                      \
1643d7b6b35Ssgrogan                               pybind11-dev                     \
16517ce36b0Striplus                               swig                             \
1660eaf34ceSBruce B. Lacey                               qt4-qmake                        \
167f2127c37Swmayer                               libqt4-opengl-dev                \
16817ce36b0Striplus                               libqtwebkit-dev                  \
16917ce36b0Striplus                               qtbase5-dev                      \
17017ce36b0Striplus                               libqt5xmlpatterns5-dev           \
17117ce36b0Striplus                               libqt5svg5-dev                   \
17217ce36b0Striplus                               libqt5opengl5-dev                \
17317ce36b0Striplus                               qttools5-dev                     \
17417ce36b0Striplus                               qtwebengine5-dev                 \
17517ce36b0Striplus                               libcoin80-dev                    \
17617ce36b0Striplus                               libpyside-dev                    \
17717ce36b0Striplus                               libpyside2-dev                   \
17817ce36b0Striplus                               libshiboken-dev                  \
17917ce36b0Striplus                               libshiboken2-dev                 \
18017ce36b0Striplus                               pyside-tools                     \
18117ce36b0Striplus                               pyside2-tools                    \
18217ce36b0Striplus                               doxygen                          \
18317ce36b0Striplus                               graphviz                         \
1843d7b6b35Ssgrogan                               libnglib-dev                     \
185cbe161b4Swmayer                               netgen                           \
18617ce36b0Striplus                               netgen-headers                   \
18717ce36b0Striplus                               libmetis-dev                     \
18817ce36b0Striplus                               libspnav-dev
189c5ac5e0eStriplus       # Runtime deps
19064cc58e3Svocx-fc       sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-pivy python3-pivy python-ply python3-ply
1916844e7edSBruce B. Lacey
192d4ea5b89Striplus       # Use newer Eigen to suppress warnings
193d4ea5b89Striplus       # https://github.com/FreeCAD/FreeCAD/pull/3485
194d4ea5b89Striplus       wget http://mirrors.kernel.org/ubuntu/pool/universe/e/eigen3/libeigen3-dev_3.3.7-2_all.deb
195d4ea5b89Striplus       sudo dpkg -i libeigen3-dev_3.3.7-2_all.deb
196d4ea5b89Striplus
197e4c94516SBruce B. Lacey       export DISPLAY=:99.0
198e4c94516SBruce B. Lacey       sh -e /etc/init.d/xvfb start
199e4c94516SBruce B. Lacey
200ca94f64cSBruce B. Lacey       export INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
20191d84472Striplus       export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/netgen/:$LD_LIRBARY_PATH
202e4c94516SBruce B. Lacey       ;;
203e4c94516SBruce B. Lacey
204e4c94516SBruce B. Lacey   "osx")
20591d84472Striplus       #xcodebuild -version -sdk
20691d84472Striplus       #brew --config
20791d84472Striplus       #if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
20891d84472Striplus       #     brew install jq
20991d84472Striplus       #     cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
21091d84472Striplus       #     travis_wait prime_local_ports_cache $cacheContext
21191d84472Striplus       #fi
21291d84472Striplus       #brew update >/dev/null
21391d84472Striplus       #brew --config
2142707ea9aSBruce B. Lacey
21591d84472Striplus       #brew tap FreeCAD/freecad
2168f5c7b44SBruce Lacey
21791d84472Striplus       #brew install --verbose --only-dependencies freecad --with-packaging-utils
21891d84472Striplus       #pip install six
21991d84472Striplus       ## Qt5:  Set Qt5 build flag and CMAKE_PREFIX
22091d84472Striplus       #QT5_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qt/*/lib/cmake)
22191d84472Striplus       #QT5_WEBKIT_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qtwebkit/*/lib/cmake)
22291d84472Striplus       #CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_QT5=ON -DCMAKE_PREFIX_PATH=${QT5_CMAKE_PREFIX};${QT5_WEBKIT_CMAKE_PREFIX}"
223e4c94516SBruce B. Lacey
22491d84472Striplus       ##Install the 3DConnexion frameworks
22591d84472Striplus       #if [ "${DEPLOY}" == "1" ]; then
22691d84472Striplus       #   if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
22791d84472Striplus       #      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'
22891d84472Striplus       #      hdiutil attach -readonly /tmp/3dFW.dmg
22991d84472Striplus       #      sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
23091d84472Striplus       #      diskutil eject /Volumes/3Dconnexion\ Software
23191d84472Striplus       #   fi
23291d84472Striplus       #   export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=ON"
23391d84472Striplus       #   export INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/MacOS/FreeCAD"
23491d84472Striplus       #else
23591d84472Striplus       #   export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
23691d84472Striplus       #fi
237e4c94516SBruce B. Lacey
23891d84472Striplus       #export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
239e4c94516SBruce B. Lacey       ;;
240e4c94516SBruce B. Lacey
2414b33a3e4Sabdullahtahiriyo   "windows")
2424b33a3e4Sabdullahtahiriyo       #choco install -y python
2434b33a3e4Sabdullahtahiriyo       #py -m pip install --quiet --upgrade pip
2444b33a3e4Sabdullahtahiriyo       #py -m pip install git+https://github.com/frerich/clcache.git@v4.2.0
2454b33a3e4Sabdullahtahiriyo       curl -L https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip --output clcache-4.2.0.zip
2464b33a3e4Sabdullahtahiriyo       7z x clcache-4.2.0.zip > /dev/null
2474b33a3e4Sabdullahtahiriyo       export PATH=$CLCACHE_PATH:$PATH
248da4946d3Sabdullahtahiriyo       export PATH=$TEST_PATH:$PATH
2494b33a3e4Sabdullahtahiriyo       #reset clcache hit stats
250a199adcdStriplus       cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -z'
2514b33a3e4Sabdullahtahiriyo       # clcache stats before compilation
252a199adcdStriplus       cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
2534b33a3e4Sabdullahtahiriyo
2549d62dca0Ssgrogan       curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19_pre/FreeCADLibs_12.1.6_x64_VC15.7z --output FreeCADLibs.7z
2554b33a3e4Sabdullahtahiriyo       7z x FreeCADLibs.7z -oFreeCADLibs > /dev/null
256a801ff5aStriplus       rm -f FreeCADLibs.7z
2579d62dca0Ssgrogan       export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15"
2584b33a3e4Sabdullahtahiriyo
2599d62dca0Ssgrogan       export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_LIBPACK_DIR=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15 -DPYTHON_EXECUTABLE=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15\bin\python.exe \
2604b33a3e4Sabdullahtahiriyo       -DBUILD_QT5=TRUE"
2614b33a3e4Sabdullahtahiriyo       export PATH=$MSBUILD_PATH:$PATH
2624b33a3e4Sabdullahtahiriyo       ;;
2634b33a3e4Sabdullahtahiriyo
264e4c94516SBruce B. Lacey   *)
265e4c94516SBruce B. Lacey       echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
266e4c94516SBruce B. Lacey       exit 1
267e4c94516SBruce B. Lacey       ;;
268e4c94516SBruce B. Lacey  esac
269dff298c5SPrzemo Firszt
270dff298c5SPrzemo Firsztinstall:
271e4c94516SBruce B. Lacey####
272e4c94516SBruce B. Lacey#  Build FreeCAD with cmake options set above for each platform
273e4c94516SBruce B. Lacey##
2744b33a3e4Sabdullahtahiriyo  - mkdir build && cd build && cmake -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
275dff298c5SPrzemo Firszt
276dff298c5SPrzemo Firsztscript:
277e4c94516SBruce B. Lacey####
278e4c94516SBruce B. Lacey#  Install FreeCAD and run unit tests.  Test failures will fail the build
279e4c94516SBruce B. Lacey##
280ab23ac4fSMarkus Reitboeck#        MSBuild.exe /m FreeCAD.sln
2814b33a3e4Sabdullahtahiriyo  - |
2824b33a3e4Sabdullahtahiriyo    if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
283a199adcdStriplus        # https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/6
2844b33a3e4Sabdullahtahiriyo        # call msbuild using clcache 
285a199adcdStriplus        #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'
286a199adcdStriplus        cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
2874b33a3e4Sabdullahtahiriyo        # ls -lahR
288a199adcdStriplus        mkdir bin/
2899d62dca0Ssgrogan        mv ../FreeCADLibs/FreeCADLibs_12.1.6_x64_VC15/bin/* bin/
290ffe01736Striplus        du -hs bin/
2914b33a3e4Sabdullahtahiriyo        # show clcache hit stats
292a199adcdStriplus        cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
2934b33a3e4Sabdullahtahiriyo        # run the tests
294a199adcdStriplus        #cmd.exe //C 'cd C:\Users\travis\build\FreeCAD\FreeCAD\build\bin && FreeCADCmd.exe --run-test 0'
295da4946d3Sabdullahtahiriyo        # Make build fail if ANY of the following fails
296bd8fc552SAbdullah Tahiri        #set -ev 
297da4946d3Sabdullahtahiriyo        winpty.exe -Xallow-non-tty -Xplain /C/Users/travis/build/FreeCAD/FreeCAD/build/bin/FreeCADCmd.exe --run-test 0 | tee runlog.txt
298bd8fc552SAbdullah Tahiri        grep -q FAILED runlog.txt ; [ $? == 1 ] && echo "Build succeeded and tests passed!" || ( echo "Tests failed!" && false )
2994b33a3e4Sabdullahtahiriyo    else
30037ca8cb3Striplus        # Stop compiling (GCC) after 2 hrs 50 min (3 hrs limit).
30117ce36b0Striplus        # Preserves created ccache for the next build job.
30291d84472Striplus        # if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
30391d84472Striplus        # if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo make -j2 install; fi
30491d84472Striplus        cat $HOME/.ccache/ccache.conf
30591d84472Striplus        ccache -z -s
30691d84472Striplus        sudo make -j2 install
30791d84472Striplus        ccache -s
30884752715Striplus        ${INSTALLED_APP_PATH} --console --run-test 0 || travis_terminate 1
3094b33a3e4Sabdullahtahiriyo        ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
3104b33a3e4Sabdullahtahiriyo        sleep 10 && pkill FreeCAD
3114b33a3e4Sabdullahtahiriyo        cat /tmp/FreeCAD_installed.log
3124b33a3e4Sabdullahtahiriyo        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 )
3134b33a3e4Sabdullahtahiriyo    fi
314140272b9SPrzemo Firszt
31591d84472Striplus#after_success:
316e4c94516SBruce B. Lacey#  Package and deploy the build to GitHub.  This will only run for builds on
317e4c94516SBruce B. Lacey#  master (i.e. pull requests are only built and tested but not deployed).
318e4c94516SBruce B. Lacey#
319e4c94516SBruce B. Lacey#  GH_TOKEN must be set in order to deploy releases to GitHub
32091d84472Striplus#
32191d84472Striplus#- |
32291d84472Striplus#  if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" -a "${DEPLOY}" == "1" ]; then
32391d84472Striplus#     brew ls --versions jq || brew install jq
32491d84472Striplus#     npm install -g appdmg
32591d84472Striplus#     export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h)
32691d84472Striplus#     export DEPLOYMENT_ARCHIVE=${VSN}-${QT}.dmg
32791d84472Striplus#     appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
32891d84472Striplus#     deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
32991d84472Striplus#     gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
33091d84472Striplus#     gitHub_prune_assets_for_release_named $deployContext "-${QT}" 1
33191d84472Striplus#  fi
33291d84472Striplus
333