appveyor.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. version: '{build}'
  2. clone_folder: c:\projects\open62541
  3. clone_depth: 20
  4. # Avoid building branch if it is part of a PR and built anyways
  5. skip_branch_with_pr: true
  6. environment:
  7. global:
  8. APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
  9. CYG_ARCH: x86
  10. CYG_ROOT: C:/cygwin
  11. CYG_SETUP_URL: http://cygwin.com/setup-x86.exe
  12. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  13. CYG_CACHE: C:\cygwin\var\cache\setup
  14. CYG_BASH: C:/cygwin/bin/bash
  15. matrix:
  16. - CC_NAME: MinGW Makefiles
  17. CC_SHORTNAME: mingw
  18. MAKE: mingw32-make -j
  19. FORCE_CXX: OFF
  20. OUT_DIR_LIB: bin
  21. OUT_DIR_EXAMPLES: bin\examples
  22. - CC_NAME: Visual Studio 9 2008
  23. CC_SHORTNAME: vs2008
  24. # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
  25. MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
  26. FORCE_CXX: ON
  27. OUT_DIR_LIB: bin\Debug
  28. OUT_DIR_EXAMPLES: bin\examples\Debug
  29. - CC_NAME: Visual Studio 12 2013
  30. CC_SHORTNAME: vs2013
  31. # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
  32. MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
  33. FORCE_CXX: OFF
  34. OUT_DIR_LIB: bin\Debug
  35. OUT_DIR_EXAMPLES: bin\examples\Debug
  36. - CC_NAME: Visual Studio 14 2015
  37. CC_SHORTNAME: vs2015
  38. # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
  39. MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
  40. FORCE_CXX: OFF
  41. OUT_DIR_LIB: bin\Debug
  42. OUT_DIR_EXAMPLES: bin\examples\Debug
  43. cache:
  44. - '%CYG_CACHE%'
  45. - 'c:\miktex'
  46. init:
  47. - git config --global core.autocrlf input # Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
  48. # Install needed build dependencies
  49. install:
  50. - git submodule update --init --recursive
  51. - if not exist "%CYG_ROOT%" mkdir "%CYG_ROOT%"
  52. - ps: echo "Installing Cygwin from $env:CYG_SETUP_URL to $env:CYG_ROOT/setup-x86.exe"
  53. - appveyor DownloadFile %CYG_SETUP_URL% -FileName %CYG_ROOT%/setup-x86.exe
  54. - ps: echo "Downloaded. Now ready to install."
  55. - cmd: '"%CYG_ROOT%/setup-x86.exe" --quiet-mode --no-shortcuts --only-site -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" --packages cmake,python'
  56. - cmd: '%CYG_BASH% -lc "cygcheck -dc cygwin"'
  57. # Install miktex to get pdflatex, if we don't get it from the cache
  58. - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe appveyor DownloadFile http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable.exe
  59. - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe 7z x miktex-portable.exe -oc:\miktex >NUL
  60. # Remove some big files to reduce size to be cached
  61. - if exist c:\miktex\texmfs\install\doc rd /s /q c:\miktex\texmfs\install\doc
  62. - if exist c:\miktex\texmfs\install\internal rd /s /q c:\miktex\texmfs\install\internal
  63. - if exist c:\miktex\texmfs\install\miktex\bin\biber.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\biber.exe
  64. - if exist c:\miktex\texmfs\install\miktex\bin\icudt58.dll rd /s /q c:\miktex\texmfs\install\miktex\bin\icudt58.dll
  65. - if exist c:\miktex\texmfs\install\miktex\bin\a5toa4.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\a5toa4.exe
  66. - pip install --user sphinx sphinx_rtd_theme
  67. - cinst graphviz.portable
  68. # Download and build libcheck
  69. - appveyor DownloadFile https://github.com/Pro/check/releases/download/0.12.0_win/check.zip
  70. - 7z x check.zip -oc:\ >NUL
  71. # Install DrMemory
  72. - cinst drmemory
  73. before_build:
  74. # use MinGW64
  75. - set PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;C:\Program Files (x86)\Dr. Memory\bin;%PATH%
  76. # Workaround for CMake not wanting sh.exe on PATH for MinGW
  77. - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  78. # Miktex
  79. - set "PATH=%PATH%;c:\miktex\texmfs\install\miktex\bin;%APPDATA%\Python\Scripts"
  80. # autoinstall latex packages (0=no, 1=autoinstall, 2=ask)
  81. # this adds this to the registry!
  82. - initexmf --set-config-value [MPM]AutoInstall=1
  83. - initexmf --update-fndb
  84. build_script:
  85. # log is loaded from cache, so we strip it here
  86. - rd /s /q c:\miktex\texmfs\data\miktex\log
  87. - cd c:\projects\open62541
  88. # Collect files for .zip packing
  89. - md pack
  90. - copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" pack\
  91. - copy "%APPVEYOR_BUILD_FOLDER%\AUTHORS" pack\
  92. - copy "%APPVEYOR_BUILD_FOLDER%\README.md" pack\
  93. # now start build
  94. - md build
  95. - cd build
  96. - echo. && echo "##### Building Documentation on %CC_NAME% #####" && echo.
  97. - cmake -DMIKTEX_BINARY_PATH=c:\miktex\texmfs\install\miktex\bin -DCMAKE_BUILD_TYPE=Release -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DUA_BUILD_EXAMPLES:BOOL=OFF -G"%CC_NAME%" ..
  98. - cmake --build . --target doc_latex & cmake --build . --target doc_pdf
  99. - move "%APPVEYOR_BUILD_FOLDER%\build\doc_latex\open62541.pdf" %APPVEYOR_BUILD_FOLDER%\pack\
  100. - cd ..
  101. - rd /s /q build
  102. - md build
  103. - cd build
  104. - echo. && echo "##### Testing %CC_NAME% #####" && echo.
  105. - cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
  106. - '%MAKE%'
  107. - cd ..
  108. - rd /s /q build
  109. - md build
  110. - cd build
  111. - echo. && echo "##### Testing %CC_NAME% with full NS0 #####" && echo.
  112. - cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_FULL_NS0:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
  113. - '%MAKE%'
  114. - cd ..
  115. - rd /s /q build
  116. - md build
  117. - cd build
  118. - echo. && echo "##### Testing %CC_NAME% with amalgamation #####" && echo.
  119. - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=OFF -G"%CC_NAME%" ..
  120. - '%MAKE%'
  121. - md %APPVEYOR_BUILD_FOLDER%\pack_tmp
  122. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  123. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  124. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  125. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  126. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  127. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.lib" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  128. - cd ..
  129. - 7z a -tzip open62541-%CC_SHORTNAME%-static.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
  130. - rd /s /q pack_tmp
  131. - rd /s /q build
  132. - md build
  133. - cd build
  134. - echo. && echo "##### Testing %CC_NAME% with amalgamation and .dll #####" && echo.
  135. - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=ON -G"%CC_NAME%" ..
  136. - '%MAKE%'
  137. - md %APPVEYOR_BUILD_FOLDER%\pack_tmp
  138. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  139. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  140. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  141. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  142. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  143. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  144. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  145. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.pdb" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  146. - cd ..
  147. - 7z a -tzip open62541-%CC_SHORTNAME%-dynamic.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
  148. - rd /s /q pack_tmp
  149. - rd /s /q build
  150. # Only execute unit tests on vs2015 to save compilation time
  151. - if "%CC_SHORTNAME%" == "vs2015" md build
  152. - if "%CC_SHORTNAME%" == "vs2015" cd build
  153. - if "%CC_SHORTNAME%" == "vs2015" echo. && echo "##### Testing %CC_NAME% with unit tests #####" && echo.
  154. - if "%CC_SHORTNAME%" == "vs2015" cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=OFF -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_BUILD_UNIT_TESTS=ON -DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON -DCMAKE_LIBRARY_PATH=c:\check\lib -DCMAKE_INCLUDE_PATH=c:\check\include -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
  155. - if "%CC_SHORTNAME%" == "vs2015" %MAKE%
  156. - if "%CC_SHORTNAME%" == "vs2015" cmake --build . --target test-verbose --config debug
  157. # do not cache log
  158. - rd /s /q c:\miktex\texmfs\data\miktex\log
  159. after_build:
  160. - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
  161. - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip