An official mirror (for now...) of the FreeCAD project. Currently maintained in sync manually by Yorik. Please check https://www.freecadweb.org for issues and pull requests https://www.freecadweb.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

333 lines
15 KiB

  1. ####
  2. # Travis-CI configuration file for FreeCAD.
  3. #
  4. # This build configuration will build and test FreeCAD on both Linux
  5. # and Mac OS X. For Mac OS X, this configuration will also package
  6. # and deploy the build to GitHub provided the following prerequisites
  7. # are satisfied:
  8. #
  9. # GH_TOKEN is defined as a secure environment variable and contains a
  10. # a valid GitHub OAUTH token with repo_deployment scope.
  11. # NOTE: Define this env using the Travis-CI Repo Settings UI
  12. #
  13. # FREECAD_RELEASE: A GitHub Release with this identifier exists in the
  14. # repo. The Travis job will deploy the OS X build to this
  15. # GitHub release name as a release asset.
  16. #
  17. # DEPLOY: Repo setting to deploy (defaults to no deploy to reduce
  18. # Travis build times. Set DEPLOY=1 to enable in repo settings.
  19. ##
  20. env:
  21. global:
  22. - GENERATOR="Unix Makefiles"
  23. - CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
  24. # - FREECAD_RELEASE="0.18"
  25. # - DEPLOY_RELEASE=${DEPLOY_RELEASE:-$FREECAD_RELEASE}
  26. # - OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
  27. # - DEPLOY=${DEPLOY:-0}
  28. # jobs:
  29. # chunk.io key (if needed, obtain it with Yorik, PrzemoF, Kunda1)
  30. # secure: MJu0ZU/9Yqut6bUkHoSrXTV/c/WhCLR0KnHKCsnEU081PYoukzH6ngzgKk7/trAH2In080d/ra4B2OmTNl/LAgV6DXKFY9dO1aG8QwcrHgaMPf0pHYUy/OfwQSFYFByQDV2OEMAHcIWc/dtNkzK2QUi44Kn7d0GtSEiN4s816lriWtjg0vmEGAU8MjvcAGss4gKyn05Xm1NUCYPKgpgIHsywLbpE76lv0eOYoosEuKv5Q9Pb4FMQts02+JUlqE8eY4ZZ3nV8iQbgIDdseOSA7Ixn05zWjU/ZRZ74TrYxMnzfUAwQcJe9OcqoESq+pPWQt5HYG66VmeVxQim1gmsiDASH51U/nswKt0Q4bISj3tVk0YZMFV8Ax+SzPvLEmFZJQGfgO1mg7HdNcz9N9G5JHPawrV19DwYIEFbAw8MCSAoIXFOcPQZUWXCbtjm7NO9vCjMrqyVJMDD9L8omvQajHoajuHbOT8KB250gFokeLj3z8yu++Tz+IrZX5inUMrXsARVt/ALXpi8rJPXmoFMpMUjyWmDPqPWlnqUhLtTtEtKpuOWP8ZnWVwkg4QYOUhCy95C1okJSGkG+ylHWncWfY4mS+UBT525laoh+GOhH+sRW+p2xkI21xGFRqg1oHjjgY1yIYF6nnSHPzxMBRYmZwagyXsjkFG5FPMWR2oYk0Yg
  31. git:
  32. depth: 5000
  33. notifications:
  34. email: false
  35. webhooks:
  36. urls:
  37. - https://webhooks.gitter.im/e/479456663cdf5c84e4d8
  38. on_success: always
  39. on_failure: always
  40. on_start: change
  41. # Inject osx build into matrix - needed to specify image/dist
  42. jobs:
  43. # allow_failures:
  44. # - python: 3.7
  45. fast_finish: true # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
  46. include:
  47. - if: type != pull_request
  48. os: linux
  49. dist: bionic
  50. language: cpp
  51. compiler: clang
  52. cache: ccache
  53. addons:
  54. apt:
  55. sources:
  56. - sourceline: 'ppa:ubuntu-toolchain-r/test'
  57. - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
  58. key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
  59. packages:
  60. - clang-10
  61. env:
  62. - CC=clang-10
  63. - CXX=clang++-10
  64. - CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
  65. - CACHE_NAME=JOB1
  66. - os: linux
  67. dist: bionic
  68. language: cpp
  69. compiler: gcc-10
  70. cache: ccache
  71. addons:
  72. apt:
  73. sources:
  74. - sourceline: 'ppa:ubuntu-toolchain-r/test'
  75. packages:
  76. - gcc-10
  77. - g++-10
  78. env:
  79. - CC=gcc-10
  80. - CXX=g++-10
  81. - CC_FOR_BUILD=gcc-10
  82. - CXX_FOR_BUILD=g++-10
  83. - 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"
  84. - CACHE_NAME=JOB2
  85. - os: linux
  86. dist: bionic
  87. language: cpp
  88. compiler: gcc-7
  89. cache: ccache
  90. env:
  91. - CC=gcc-7
  92. - CXX=g++-7
  93. - CC_FOR_BUILD=gcc-7
  94. - CXX_FOR_BUILD=g++-7
  95. - CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc"
  96. - CACHE_NAME=JOB3
  97. - os: windows
  98. language: cpp
  99. env:
  100. - CMAKE_OPTS="-DBUILD_FEM_NETGEN=ON -DFREECAD_RELEASE_PDB=OFF -DFREECAD_RELEASE_SEH=OFF"
  101. - GENERATOR="Visual Studio 15 2017 Win64"
  102. - PYTHON_MAJOR_VERSION=3
  103. - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
  104. - TEST_PATH="C:\Users\travis\build\FreeCAD\FreeCAD\build\bin"
  105. - CLCACHE_PATH="C:\Users\travis\build\FreeCAD\FreeCAD"
  106. - VS15=true
  107. - CCACHE_TEMPDIR=/tmp/.ccache-temp
  108. - CCACHE_COMPRESS=1
  109. - CCACHE_DIR=$HOME/.ccache
  110. - CACHE_NAME=JOB5
  111. # enable this if clcache extended log is needed
  112. #- CLCACHE_LOG=1
  113. cache:
  114. directories:
  115. - $HOME/clcache
  116. # - language: python
  117. # python: 3.7
  118. # dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
  119. # before_install: true
  120. # install: python3 -m pip install flake8
  121. # # fail the build if there are Python syntax errors or undefined names
  122. # script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
  123. before_install:
  124. # - eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
  125. - |
  126. case "${TRAVIS_OS_NAME}" in
  127. "linux")
  128. # Daily PPA for OCCT, Pivy, Netgen, PySide ... packages
  129. sudo apt-add-repository -y ppa:freecad-maintainers/freecad-daily
  130. sudo apt-get update -qq
  131. # Build deps
  132. sudo apt-get install -y --no-install-recommends \
  133. python-dev \
  134. python-pyside \
  135. python-matplotlib \
  136. python3-dev \
  137. python3-pyside \
  138. python3-matplotlib \
  139. libboost1.65-dev \
  140. libboost-filesystem1.65-dev \
  141. libboost-program-options1.65-dev \
  142. libboost-python1.65-dev \
  143. libboost-regex1.65-dev \
  144. libboost-signals1.65-dev \
  145. libboost-system1.65-dev \
  146. libboost-thread1.65-dev \
  147. libxerces-c-dev \
  148. libocct-data-exchange-dev \
  149. libocct-ocaf-dev \
  150. libocct-visualization-dev \
  151. libvtk7-dev \
  152. libmedc-dev \
  153. pybind11-dev \
  154. swig \
  155. qt4-qmake \
  156. libqt4-opengl-dev \
  157. libqtwebkit-dev \
  158. qtbase5-dev \
  159. libqt5xmlpatterns5-dev \
  160. libqt5svg5-dev \
  161. libqt5opengl5-dev \
  162. qttools5-dev \
  163. qtwebengine5-dev \
  164. libcoin80-dev \
  165. libpyside-dev \
  166. libpyside2-dev \
  167. libshiboken-dev \
  168. libshiboken2-dev \
  169. pyside-tools \
  170. pyside2-tools \
  171. doxygen \
  172. graphviz \
  173. libnglib-dev \
  174. netgen \
  175. netgen-headers \
  176. libmetis-dev \
  177. libspnav-dev
  178. # Runtime deps
  179. sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-pivy python3-pivy python-ply python3-ply
  180. # Use newer Eigen to suppress warnings
  181. # https://github.com/FreeCAD/FreeCAD/pull/3485
  182. wget http://mirrors.kernel.org/ubuntu/pool/universe/e/eigen3/libeigen3-dev_3.3.7-2_all.deb
  183. sudo dpkg -i libeigen3-dev_3.3.7-2_all.deb
  184. export DISPLAY=:99.0
  185. sh -e /etc/init.d/xvfb start
  186. export INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
  187. export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/netgen/:$LD_LIRBARY_PATH
  188. ;;
  189. "osx")
  190. #xcodebuild -version -sdk
  191. #brew --config
  192. #if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
  193. # brew install jq
  194. # cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
  195. # travis_wait prime_local_ports_cache $cacheContext
  196. #fi
  197. #brew update >/dev/null
  198. #brew --config
  199. #brew tap FreeCAD/freecad
  200. #brew install --verbose --only-dependencies freecad --with-packaging-utils
  201. #pip install six
  202. ## Qt5: Set Qt5 build flag and CMAKE_PREFIX
  203. #QT5_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qt/*/lib/cmake)
  204. #QT5_WEBKIT_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qtwebkit/*/lib/cmake)
  205. #CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_QT5=ON -DCMAKE_PREFIX_PATH=${QT5_CMAKE_PREFIX};${QT5_WEBKIT_CMAKE_PREFIX}"
  206. ##Install the 3DConnexion frameworks
  207. #if [ "${DEPLOY}" == "1" ]; then
  208. # if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
  209. # 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'
  210. # hdiutil attach -readonly /tmp/3dFW.dmg
  211. # sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
  212. # diskutil eject /Volumes/3Dconnexion\ Software
  213. # fi
  214. # export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=ON"
  215. # export INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/MacOS/FreeCAD"
  216. #else
  217. # export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
  218. #fi
  219. #export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
  220. ;;
  221. "windows")
  222. #choco install -y python
  223. #py -m pip install --quiet --upgrade pip
  224. #py -m pip install git+https://github.com/frerich/clcache.git@v4.2.0
  225. curl -L https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip --output clcache-4.2.0.zip
  226. 7z x clcache-4.2.0.zip > /dev/null
  227. export PATH=$CLCACHE_PATH:$PATH
  228. export PATH=$TEST_PATH:$PATH
  229. #reset clcache hit stats
  230. cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -z'
  231. # clcache stats before compilation
  232. cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
  233. curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19_pre/FreeCADLibs_12.1.4_x64_VC15.7z --output FreeCADLibs.7z
  234. 7z x FreeCADLibs.7z -oFreeCADLibs > /dev/null
  235. rm -f FreeCADLibs.7z
  236. export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15"
  237. 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 \
  238. -DBUILD_QT5=TRUE"
  239. export PATH=$MSBUILD_PATH:$PATH
  240. ;;
  241. *)
  242. echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
  243. exit 1
  244. ;;
  245. esac
  246. install:
  247. ####
  248. # Build FreeCAD with cmake options set above for each platform
  249. ##
  250. - mkdir build && cd build && cmake -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
  251. script:
  252. ####
  253. # Install FreeCAD and run unit tests. Test failures will fail the build
  254. ##
  255. # MSBuild.exe /m FreeCAD.sln
  256. - |
  257. if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
  258. # https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/6
  259. # call msbuild using clcache
  260. #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'
  261. cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
  262. # ls -lahR
  263. mkdir bin/
  264. mv ../FreeCADLibs/FreeCADLibs_12.1.4_x64_VC15/bin/* bin/
  265. du -hs bin/
  266. # show clcache hit stats
  267. cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
  268. # run the tests
  269. #cmd.exe //C 'cd C:\Users\travis\build\FreeCAD\FreeCAD\build\bin && FreeCADCmd.exe --run-test 0'
  270. # Make build fail if ANY of the following fails
  271. #set -ev
  272. winpty.exe -Xallow-non-tty -Xplain /C/Users/travis/build/FreeCAD/FreeCAD/build/bin/FreeCADCmd.exe --run-test 0 | tee runlog.txt
  273. grep -q FAILED runlog.txt ; [ $? == 1 ] && echo "Build succeeded and tests passed!" || ( echo "Tests failed!" && false )
  274. else
  275. # Stop compiling (GCC) after 2 hrs 50 min (3 hrs limit).
  276. # Preserves created ccache for the next build job.
  277. # if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
  278. # if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo make -j2 install; fi
  279. cat $HOME/.ccache/ccache.conf
  280. ccache -z -s
  281. sudo make -j2 install
  282. ccache -s
  283. ${INSTALLED_APP_PATH} --console --run-test 0 || travis_terminate 1
  284. ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
  285. sleep 10 && pkill FreeCAD
  286. cat /tmp/FreeCAD_installed.log
  287. 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 )
  288. fi
  289. #after_success:
  290. # Package and deploy the build to GitHub. This will only run for builds on
  291. # master (i.e. pull requests are only built and tested but not deployed).
  292. #
  293. # GH_TOKEN must be set in order to deploy releases to GitHub
  294. #
  295. #- |
  296. # if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" -a "${DEPLOY}" == "1" ]; then
  297. # brew ls --versions jq || brew install jq
  298. # npm install -g appdmg
  299. # export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h)
  300. # export DEPLOYMENT_ARCHIVE=${VSN}-${QT}.dmg
  301. # appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
  302. # deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
  303. # gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
  304. # gitHub_prune_assets_for_release_named $deployContext "-${QT}" 1
  305. # fi