1# Copyright (c) 2014, Ruslan Baratov
2# Copyright (c) 2014, 2016 Alexander Lamaison
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are met:
7#
8# * Redistributions of source code must retain the above copyright notice, this
9#   list of conditions and the following disclaimer.
10#
11# * Redistributions in binary form must reproduce the above copyright notice,
12#   this list of conditions and the following disclaimer in the documentation
13#   and/or other materials provided with the distribution.
14#
15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26os: Visual Studio 2015
27
28environment:
29  matrix:
30    - GENERATOR: "Visual Studio 14 2015"
31      BUILD_SHARED_LIBS: ON
32      CRYPTO_BACKEND: "OpenSSL"
33
34    - GENERATOR: "Visual Studio 14 2015"
35      BUILD_SHARED_LIBS: OFF
36      CRYPTO_BACKEND: "OpenSSL"
37
38    - GENERATOR: "Visual Studio 12 2013"
39      BUILD_SHARED_LIBS: ON
40      CRYPTO_BACKEND: "OpenSSL"
41
42    - GENERATOR: "Visual Studio 12 2013"
43      BUILD_SHARED_LIBS: OFF
44      CRYPTO_BACKEND: "OpenSSL"
45
46    - GENERATOR: "Visual Studio 14 2015"
47      BUILD_SHARED_LIBS: ON
48      CRYPTO_BACKEND: "WinCNG"
49
50    - GENERATOR: "Visual Studio 14 2015"
51      BUILD_SHARED_LIBS: OFF
52      CRYPTO_BACKEND: "WinCNG"
53
54    - GENERATOR: "Visual Studio 12 2013"
55      BUILD_SHARED_LIBS: ON
56      CRYPTO_BACKEND: "WinCNG"
57
58    - GENERATOR: "Visual Studio 12 2013"
59      BUILD_SHARED_LIBS: OFF
60      CRYPTO_BACKEND: "WinCNG"
61
62  digitalocean_access_token:
63    secure: 8qRitvrj69Xhf0Tmu27xnz5drmL2YhmOJLGpXIkYyTCC0JNtBoXW6fMcF3u4Uj1+pIQ+TjegQOwYimlz0oivKTro3v3EXro+osAMNJG6NKc=
64
65platform:
66  - x86
67  - x64
68
69configuration:
70# - Debug
71  - Release
72
73matrix:
74  fast_finish: true
75  allow_failures:
76    - GENERATOR: "Visual Studio 9 2008"
77      platform: x64
78
79install:
80  - choco install -y docker
81  - choco install -y docker-machine
82
83build_script:
84  - ps: if($env:PLATFORM -eq "x64") { $env:CMAKE_GEN_SUFFIX=" Win64" }
85  - cmake "-G%GENERATOR%%CMAKE_GEN_SUFFIX%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% -DCRYPTO_BACKEND=%CRYPTO_BACKEND% -H. -B_builds
86  - cmake --build _builds --config "%CONFIGURATION%"
87
88before_test:
89  - set DOCKER_MACHINE_NAME=appveyor-%APPVEYOR_PROJECT_SLUG%-%APPVEYOR_JOB_ID%
90  - ps: if($env:digitalocean_access_token) { echo "Using DigitalOcean for testing." } else { echo "DigitalOcean not available. Skipping testing." }
91  - ps: if($env:digitalocean_access_token) { docker-machine create --driver digitalocean --digitalocean-access-token $($env:digitalocean_access_token) $($env:DOCKER_MACHINE_NAME) }
92  - ps: if($env:digitalocean_access_token) { docker-machine env $($env:DOCKER_MACHINE_NAME) --shell powershell | Invoke-Expression }
93
94test_script:
95  - ps: cd _builds
96  - ps: if($env:digitalocean_access_token) { ctest -VV -C $($env:CONFIGURATION) --output-on-failure }
97
98after_test:
99  - ps: if($env:digitalocean_access_token) { docker-machine rm -y $($env:DOCKER_MACHINE_NAME) }
100
101on_failure:
102  - ps: if($env:digitalocean_access_token) { docker-machine rm -y $($env:DOCKER_MACHINE_NAME) }
103  - ps: if(Test-Path _builds/CMakeFiles/CMakeOutput.log) { cat _builds/CMakeFiles/CMakeOutput.log }
104  - ps: if(Test-Path _builds/CMakeFiles/CMakeError.log) { cat _builds/CMakeFiles/CMakeError.log }
105
106# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
107branches:
108    only:
109        - master
110