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.
 
 
 
 
 
 

361 lines
17 KiB

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