aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/ci/appveyor.yml
blob: eef1e758cad08040f7be34b45d683c001aef092c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Let's call MSVS 2015 the default compiler, 64 bit the default architecture,
# release the default configuration and --enable-shared the default mode.
#
# Build jobs
#  1. six basic builds: 32/64bit on MSVS2013/2015/2017
#  2. add static lib and amalgamation
#  3. add a debug build on MSVS2013/2015
#
# Note: Avoid the AppVeyor settings `platform` and `configuration` since excluding
# from the build matrix is not supported (https://github.com/appveyor/ci/issues/386)

environment:
  matrix:
    # 1
    - MSVS: 2013
      PLATFORM: x86
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS: 2013
      PLATFORM: x86_amd64
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS: 2015
      PLATFORM: x86
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS: 2015
      PLATFORM: x86_amd64
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS: 2017
      PLATFORM: x86
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
    - MSVS: 2017
      PLATFORM: x86_amd64
      CONFIG:
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
    # 2
    - MSVS:
      PLATFORM:
      CONFIG:
      MODE: --disable-shared
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS:
      PLATFORM:
      CONFIG:
      MODE: --amalgamation
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    # 3
    - MSVS: 2013
      PLATFORM:
      CONFIG: Debug
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    - MSVS: 2015
      PLATFORM:
      CONFIG: Debug
      MODE:
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

install:
  # Set defaults
  - if [%MSVS%] == [] set MSVS=2015
  - if [%PLATFORM%] == [] set PLATFORM=x86_amd64
  - if [%CONFIG%] == [] set CONFIG=Release
  - if [%MODE%] == [] set MODE=--enable-shared

  # Check setup
  - echo Current build setup MSVS="%MSVS%" PLATFORM="%PLATFORM%" CONFIG="%CONFIG%" MODE="%MODE%"

  # Choose compiler
  - if %MSVS% == 2013 (
       call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM%
    )
  - if %MSVS% == 2015 (
       call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
    )
  - if %MSVS% == 2017 (
       call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
    )
  - cl # check compiler version
  
  - appveyor DownloadFile http://download.qt.io/official_releases/jom/jom.zip -FileName jom.zip
  - 7z e jom.zip

build_script:
  - if %CONFIG% == Release (
       python configure.py --cc=msvc --cpu=%PLATFORM% %MODE%
    )
  - if %CONFIG% == Debug (
       python configure.py --cc=msvc --cpu=%PLATFORM% %MODE% --debug-mode
    )
  - jom -j2
  - botan-test
  - nmake install

# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
branches:
  only:
    - master