appveyor.yml 3.6 KB
Newer Older
1
version: 4.0.0.{build}
2

3 4
configuration: Release

5
environment:
6 7 8
  MINGW_ARCHIVE: C:\projects\mingw\x86_64-4.8.3-release-posix-seh-rt_v3-rev2.7z
  MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.8.3/threads-posix/seh/x86_64-4.8.3-release-posix-seh-rt_v3-rev2.7z/download
  matrix:
9 10 11 12 13 14 15
    - G: "Visual Studio 15 2017 Win64"
      BOOST_ROOT: C:\Libraries\boost_1_59_0
      POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.6
      MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
    - G: "Visual Studio 14 2015 Win64"
      BOOST_ROOT: C:\Libraries\boost_1_59_0
16 17
      POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4
      MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
18
    - G: "Visual Studio 12 2013 Win64"
19 20 21
      BOOST_ROOT: C:\Libraries\boost_1_58_0
      POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4
      MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
22 23
    - G: "Visual Studio 11 2012 Win64"
      BOOST_ROOT: C:\Libraries\boost_1_58_0
24 25
      POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4
      MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
26
    - G: "MinGW Makefiles"
27 28 29 30
      MINGW_ROOT: C:\projects\mingw\4.8.3\mingw64\bin
      BOOST_ROOT: C:\Libraries\boost_1_59_0
      POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4
      MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7
31

32
services:
33 34 35
  - mssql2014
  - mysql
  - postgresql
36

37
cache:
38
  - C:\projects\mingw
39 40

install:
41
  - ps: |
42
      if ($env:G -eq "MinGW Makefiles")
43 44 45 46 47 48 49 50 51 52 53 54 55 56
      {
        if (!(Test-Path C:\projects\mingw))
        {
          mkdir C:\projects\mingw
        }
        if (!(Test-Path $env:MINGW_ARCHIVE))
        {
          (new-object net.webclient).DownloadFile("$env:MINGW_URL", "$env:MINGW_ARCHIVE")
          7z x -y -oC:\projects\mingw\4.8.3\ $env:MINGW_ARCHIVE > $null
        }
      }
      Import-Module C:\projects\soci\scripts\windows\Get-ODBCList.ps1
      Get-ODBCList
  - git clone https://github.com/snikulov/sqlite.cmake.build.git C:\projects\sqlite\src
57

58
before_build:
59 60
  # dirty little hack - remove sh from Git to make generator happy
  - ps: |
61
      if ($env:G -eq "MinGW Makefiles")
62 63 64 65 66
      {
        $shellPath = (Get-Command sh.exe).definition
        if ($shellPath)
        {
          if (Test-Path $shellPath)
Sergei Nikulov's avatar
Sergei Nikulov committed
67
          {
68
            Remove-Item $shellPath
Sergei Nikulov's avatar
Sergei Nikulov committed
69
          }
70 71 72
        }
      }
  - cd C:\projects\sqlite\src
73 74 75
  - mkdir build
  - cd build
  - set SQLITE_ROOT=C:\projects\sqlite\sqlite
76 77 78 79 80 81 82 83 84 85
  - set PATH=%MINGW_ROOT%;%PATH%;%SQLITE_ROOT%\bin;%POSTGRESQL_ROOT%\bin;%MYSQL_DIR%\bin;%MYSQL_DIR%\lib
  - 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)\SQL2014 -i C:\projects\soci\scripts\windows\mssql_db_create.sql
86 87
  - cmake .. -G"%G%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=C:\projects\sqlite\sqlite
  - cmake --build . --config %CONFIGURATION% --target install
88 89

build_script:
90
  - cd C:\projects\soci
91 92 93 94
  - mkdir build
  - cd build
  - cmake .. -G"%G%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_VERBOSE_MAKEFILE=ON
  - cmake --build . --config %CONFIGURATION% --clean-first
95

96
test_script:
97
  - ctest -V --output-on-failure -R "soci_empty|soci_postgresql|soci_sqlite3|soci_odbc_test_mssql|soci_mysql|soci_odbc_test_mysql|soci_odbc_test_postgresql"
98

99
notifications:
100 101 102 103 104
  - provider: Webhook
    url: https://webhooks.gitter.im/e/2038138a652d952f9372
    on_build_success: true
    on_build_failure: true
    on_build_status_changed: true