appveyor.yml 8.9 KB

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