mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-29 09:33:26 +00:00
This was broken by 2890781e (Simplify CMake configuration command used
under AppVeyor, 2025-06-13) which didn't change the current directory to
the build directory any longer and went unnoticed for a long, long time.
Specify the build directory explicitly when running ctest to fix this.
123 lines
4.7 KiB
YAML
123 lines
4.7 KiB
YAML
version: 4.2.0.{build}
|
|
|
|
skip_commits:
|
|
files:
|
|
- .github/workflows/
|
|
|
|
environment:
|
|
matrix:
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
G: "MinGW Makefiles"
|
|
CONFIGURATION: Release
|
|
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.5
|
|
POSTGRESQL_VER: 9.5
|
|
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 2017
|
|
G: "Ninja"
|
|
CONFIGURATION: Debug
|
|
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/2017/Community/VC/Auxiliary/Build"
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
G: "Ninja"
|
|
CONFIGURATION: Release
|
|
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 2019
|
|
G: "Visual Studio 16 2019"
|
|
CONFIGURATION: Debug
|
|
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"
|
|
|
|
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"
|
|
# Ensure we have a recent cmake version available
|
|
- choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
|
|
- refreshenv
|
|
- git submodule update --init
|
|
|
|
before_build:
|
|
# 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:BUILD_TOOL_OPTIONS = '-j3'
|
|
}
|
|
else
|
|
{
|
|
$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])"
|
|
}
|
|
}
|
|
}
|
|
- 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
|
|
|
|
build_script:
|
|
- cd C:\projects\soci
|
|
- cmake -S . -B build -G"%G%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_VERBOSE_MAKEFILE=ON -DSOCI_ENABLE_WERROR=ON -DCMAKE_UNITY_BUILD=ON
|
|
- cmake --build build --config %CONFIGURATION% -- %BUILD_TOOL_OPTIONS%
|
|
|
|
test_script:
|
|
- ctest --test-dir build -V --timeout 300 --output-on-failure --no-tests=error --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'))
|