-
Notifications
You must be signed in to change notification settings - Fork 486
/
Copy pathappveyor.yml
139 lines (131 loc) · 5.45 KB
/
appveyor.yml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: 4.1.0.{build}
skip_commits:
files:
- .github/workflows/
configuration: Release
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
G: "Ninja"
BOOST_ROOT: C:\Libraries\boost_1_84_0
MSSQL_VER: 2019
POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\15
POSTGRESQL_VER: 15
MYSQL_VER: 80
MYSQL_DIR: C:\Program Files\MySql\MySQL Server 8.0
VCVARS_SCRIPT: "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
G: "Ninja"
BOOST_ROOT: C:\Libraries\boost_1_77_0
MSSQL_VER: 2017
POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\13
POSTGRESQL_VER: 13
MYSQL_VER: 80
MYSQL_DIR: C:\Program Files\MySql\MySQL Server 8.0
VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
G: "Ninja"
BOOST_ROOT: C:\Libraries\boost_1_69_0
MSSQL_VER: 2016
POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\12
POSTGRESQL_VER: 12
MYSQL_VER: 57
MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
G: "Ninja"
BOOST_ROOT: C:\Libraries\boost_1_60_0
MSSQL_VER: 2014
POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\11
POSTGRESQL_VER: 11
MYSQL_VER: 57
MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
G: "MinGW Makefiles"
MINGW_BIN: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
MSSQL_VER: 2014
BOOST_ROOT: C:\Libraries\boost_1_60_0
POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4
POSTGRESQL_VER: 9.4
MYSQL_VER: 57
MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC"
install:
# Start these ones here as we can't specify the service name dynamically above.
- net start mssql$SQL%MSSQL_VER%
- net start mysql%MYSQL_VER%
- net start postgresql-x64-%POSTGRESQL_VER%
- ps: |
Import-Module C:\projects\soci\scripts\windows\Get-ODBCList.ps1
$drivers_list = Get-ODBCList
Write-Output $drivers_list
$env:SOCI_ODBC_SKIP_TESTS = "soci_odbc_test_ms_access"
if (-Not ($drivers_list -contains 'MySQL')) {
$env:SOCI_ODBC_SKIP_TESTS = $env:SOCI_ODBC_SKIP_TESTS + '|soci_odbc_test_mysql'
}
if (-Not ($drivers_list -contains 'PostgreSQL')) {
$env:SOCI_ODBC_SKIP_TESTS = $env:SOCI_ODBC_SKIP_TESTS + '|soci_odbc_test_postgresql'
}
Write-Output "To be skipped ODBC tests: $env:SOCI_ODBC_SKIP_TESTS"
- git clone https://github.com/snikulov/sqlite.cmake.build.git C:\projects\sqlite\src
# Ensure we have a recent cmake version available
- choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- refreshenv
before_build:
- set SQLITE_ROOT=C:\projects\sqlite\sqlite
# dirty little hack - remove sh from Git to make generator happy
- ps: |
if ($env:G -eq "MinGW Makefiles")
{
$shellPath = (Get-Command sh.exe).definition
if ($shellPath)
{
if (Test-Path $shellPath)
{
Remove-Item $shellPath
}
}
$env:SQLITE3_LIBRARY = $env:SQLITE_ROOT + '/lib/libsqlite3-static.a'
$env:BUILD_TOOL_OPTIONS = '-j3'
}
else
{
$env:SQLITE3_LIBRARY = $env:SQLITE_ROOT + '/lib/sqlite3-static.lib'
$env:BUILD_TOOL_OPTIONS = ''
# Set up Visual Studio environment (MSVC compiler etc.)
# Works by calling the respective bat script and then copying over the env vars
cd $env:VCVARS_SCRIPT
cmd /c "vcvarsall.bat x64&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
}
- cd C:\projects\sqlite\src
- mkdir build
- cd build
- set PATH=%MINGW_BIN%;%POSTGRESQL_ROOT%\bin;%MYSQL_DIR%\bin;%MYSQL_DIR%\lib;%PATH%
- echo %PATH%
- cmake --version
- set PGUSER=postgres
- set PGPASSWORD=Password12!
- createdb soci_test
- set MYSQL_PWD=Password12!
- set USER=root
- mysql -e "create database soci_test;" --user=root
- sqlcmd -U sa -P Password12! -S (local)\SQL%MSSQL_VER% -i C:\projects\soci\scripts\windows\mssql_db_create.sql
- cmake .. -G"%G%" -DSQLITE_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%SQLITE_ROOT% -DCMAKE_UNITY_BUILD=ON
- cmake --build . --config %CONFIGURATION% --target install
build_script:
- cd C:\projects\soci
- mkdir build
- cd build
- cmake .. -G"%G%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_VERBOSE_MAKEFILE=ON -DSOCI_ENABLE_WERROR=ON -DCMAKE_PREFIX_PATH=%SQLITE_ROOT% -DSQLite3_LIBRARY=%SQLITE3_LIBRARY% -DCMAKE_UNITY_BUILD=ON
- cmake --build . --config %CONFIGURATION% -- %BUILD_TOOL_OPTIONS%
test_script:
- ctest -V --timeout 300 --output-on-failure --build-config %CONFIGURATION% --exclude-regex "%SOCI_ODBC_SKIP_TESTS%"
# Uncomment this to wait for RDP connection after the build end.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))