appveyor.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. version: '{build}'
  2. os: Visual Studio 2015
  3. environment:
  4. matrix:
  5. - compiler: msvc-15-seh
  6. generator: "Visual Studio 15 2017"
  7. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  8. - compiler: msvc-15-seh
  9. generator: "Visual Studio 15 2017 Win64"
  10. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  11. enabled_on_pr: yes
  12. - compiler: msvc-14-seh
  13. generator: "Visual Studio 14 2015"
  14. enabled_on_pr: yes
  15. - compiler: msvc-14-seh
  16. generator: "Visual Studio 14 2015 Win64"
  17. - compiler: gcc-5.3.0-posix
  18. generator: "MinGW Makefiles"
  19. cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin'
  20. - compiler: gcc-6.3.0-posix
  21. generator: "MinGW Makefiles"
  22. cxx_path: 'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin'
  23. configuration:
  24. - Debug
  25. build:
  26. verbosity: minimal
  27. install:
  28. - ps: |
  29. Write-Output "Compiler: $env:compiler"
  30. Write-Output "Generator: $env:generator"
  31. if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
  32. Write-Output "This is *NOT* a pull request build"
  33. } else {
  34. Write-Output "This is a pull request build"
  35. if (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes") {
  36. Write-Output "PR builds are *NOT* explicitly enabled"
  37. }
  38. }
  39. # git bash conflicts with MinGW makefiles
  40. if ($env:generator -eq "MinGW Makefiles") {
  41. $env:path = $env:path.replace("C:\Program Files\Git\usr\bin;", "")
  42. if ($env:cxx_path -ne "") {
  43. $env:path += ";$env:cxx_path"
  44. }
  45. }
  46. build_script:
  47. - ps: |
  48. # Only enable some builds for pull requests, the AppVeyor queue is too long.
  49. if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) {
  50. return
  51. }
  52. md _build -Force | Out-Null
  53. cd _build
  54. $conf = if ($env:generator -eq "MinGW Makefiles") {"-DCMAKE_BUILD_TYPE=$env:configuration"} else {"-DCMAKE_CONFIGURATION_TYPES=Debug;Release"}
  55. # Disable test for MinGW (gtest tests fail, gmock tests can not build)
  56. $gtest_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgtest_build_tests=OFF"} else {"-Dgtest_build_tests=ON"}
  57. $gmock_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgmock_build_tests=OFF"} else {"-Dgmock_build_tests=ON"}
  58. & cmake -G "$env:generator" $conf -Dgtest_build_samples=ON $gtest_build_tests $gmock_build_tests ..
  59. if ($LastExitCode -ne 0) {
  60. throw "Exec: $ErrorMessage"
  61. }
  62. $cmake_parallel = if ($env:generator -eq "MinGW Makefiles") {"-j2"} else {"/m"}
  63. & cmake --build . --config $env:configuration -- $cmake_parallel
  64. if ($LastExitCode -ne 0) {
  65. throw "Exec: $ErrorMessage"
  66. }
  67. skip_commits:
  68. files:
  69. - '**/*.md'
  70. test_script:
  71. - ps: |
  72. # Only enable some builds for pull requests, the AppVeyor queue is too long.
  73. if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) {
  74. return
  75. }
  76. if ($env:generator -eq "MinGW Makefiles") {
  77. return # No test available for MinGW
  78. }
  79. & ctest -C $env:configuration --timeout 600 --output-on-failure
  80. if ($LastExitCode -ne 0) {
  81. throw "Exec: $ErrorMessage"
  82. }
  83. artifacts:
  84. - path: '_build/CMakeFiles/*.log'
  85. name: logs
  86. - path: '_build/Testing/**/*.xml'
  87. name: test_results