mirror of
https://github.com/SOCI/soci.git
synced 2026-05-08 04:40:25 -05:00
b7d0b7af81
Fix the workflow which was added in master to make it possible to use it, but which didn't work yet. Build SOCI under Windows using MSVC and run the tests that we can easily run in the GitHub Actions environment (to run the other ones we would need to set up PostgreSQL ODBC drivers and MySQL and SQL Server databases ourselves).
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
# Continuous integration workflow for SOCI Windows builds.
|
|
name: Windows CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- 'release/**'
|
|
paths-ignore:
|
|
- .circleci/**
|
|
- .cirrus.yml
|
|
- .github/workflows/ci.yml
|
|
- .github/workflows/codeql.yml
|
|
- appveyor.yml
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- .circleci/**
|
|
- .cirrus.yml
|
|
- .github/workflows/ci.yml
|
|
- .github/workflows/codeql.yml
|
|
- appveyor.yml
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- lib_type: shared
|
|
build_type: Debug
|
|
- lib_type: shared
|
|
build_type: Release
|
|
unity_build: true
|
|
- lib_type: static
|
|
build_type: Release
|
|
|
|
runs-on: windows-2022
|
|
name: MSVS ${{ matrix.lib_type }} ${{ matrix.build_type }} ${{ matrix.unity_build && '(unity build)' || '' }}
|
|
|
|
env:
|
|
SOCI_CI: true
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Set up MSVS environment
|
|
uses: seanmiddleditch/gha-setup-vsdevenv@v5
|
|
|
|
- name: Set up PostgreSQL
|
|
run: |
|
|
$pgService = Get-Service -Name postgresql*
|
|
Set-Service -InputObject $pgService -Status running -StartupType automatic
|
|
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait
|
|
& $env:PGBIN\createdb soci_test
|
|
|
|
- name: Configure
|
|
run: |
|
|
$soci_shared = "${{ matrix.lib_type }}" -eq "shared" ? "ON" : "OFF"
|
|
$soci_enable_unity_build = "${{ matrix.unity_build }}" ? "ON" : "OFF"
|
|
cmake -S . -B build -GNinja `
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON `
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
|
|
-DCMAKE_UNITY_BUILD=$soci_enable_unity_build `
|
|
-DWITH_BOOST=OFF `
|
|
-DSOCI_DB2=OFF `
|
|
-DSOCI_FIREBIRD=OFF `
|
|
-DSOCI_ORACLE=OFF `
|
|
-DSOCI_SHARED=$soci_shared `
|
|
-DSOCI_ENABLE_WERROR=ON
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake --build build
|
|
|
|
- name: Test
|
|
run: |
|
|
ctest --test-dir build -V --timeout 300 --output-on-failure --exclude-regex "soci_mysql_test|soci_odbc_test_.*"
|