Skip to content

workflows drivers for msvc2022 Qt6 #18

workflows drivers for msvc2022 Qt6

workflows drivers for msvc2022 Qt6 #18

# MySQL
# ---
# Forces TLS connections with the caching_sha2_password and certificate validation, also validates
# issuer == CN=MySQL_Server_TinyORM_Auto_Generated_CA_Certificate and
# subject == CN=MySQL_Server_TinyORM_Auto_Generated_Client_Certificate.
# PostgreSQL
# ---
# Forces TLS connections with the certificate authentication and full certificate validation
# using the clientname=DN map=dn in the pg_hba.conf, so the username is matched against
# the entire Distinguished Name (DN) of the client certificate and sslmode=verify-full
# on the libpq client side, so the the server host name is matched against the CN (Common Name)
# stored in the server certificate.
name: MSVC2022 Qt6.7 TinyDrivers
on:
push:
branches:
- main
- gh-actions
- silverqx-develop
# I will not remove the build folders before a job execution it's not necessary and
# it will be faster this way. I can still remove them manually if needed or
# if something goes wrong.
jobs:
build:
name: cmake build / ctest
# Self-hosted runner is Windows 11 (Release Preview channel - 23H2)
runs-on: [self-hosted, windows]
strategy:
matrix:
build-type:
- key: debug
name: Debug
- key: release
name: Release
steps:
- uses: actions/checkout@v4
with:
path: main
- name: TinyORM prepare environment
run: |
$runnerWorkPath = Resolve-Path -Path '${{ runner.workspace }}/..'
"TinyRunnerWorkPath=$runnerWorkPath" >> $env:GITHUB_ENV
$mysqlExePath = (Get-Command -Name mysql.exe).Source
$mysqlInstallationPath = Split-Path -Parent -Path (Split-Path -Parent -Path $mysqlExePath)
"TinyMySQLInstallationPath=$mysqlInstallationPath" >> $env:GITHUB_ENV
"TinyParallel=5" >> $env:GITHUB_ENV
$tinyormPath = Resolve-Path -Path ./main
"TinyORMPath=$tinyormPath" >> $env:GITHUB_ENV
env:
DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }}
- name: MySQL add libmysql.dll on the $env:Path, INCLUDE, and LIB
run: |
'${{ env.TinyMySQLInstallationPath }}\lib' >> $env:GITHUB_PATH
# Needed by the lastest FindMySQL.cmake module, it stopped working without this
'INCLUDE=${{ env.TinyMySQLInstallationPath }}\include' >> $env:GITHUB_ENV
'LIB=${{ env.TinyMySQLInstallationPath }}\lib' >> $env:GITHUB_ENV
- name: MySQL service check status
run: |
$serviceName = 'MySQL83'
Write-Output '::group::Get-Service'
$mysqlService = Get-Service $serviceName
Write-Output $mysqlService
Write-Output '::endgroup::'
Write-Output '::group::Service running check'
$mysqlService.status.ToString() -ceq 'Running' -or `
$(throw "$serviceName service is not running") > $null
Write-Output '::endgroup::'
# Write-Output '::group::Ping'
# mysqladmin.exe --user=$env:DB_MYSQL_USERNAME --password=$env:DB_MYSQL_PASSWORD ping
# Write-Output '::endgroup::'
env:
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD_SELF }}
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF }}
- name: Print MySQL database versions
run: |
Write-Output '::group::MySQL version'
mysql.exe --version
Write-Output '::endgroup::'
- name: Ninja install latest version
uses: seanmiddleditch/gha-setup-ninja@master
with:
destination: ${{ env.TinyRunnerWorkPath }}/ninja-build
- name: Visual Studio 2022 pwsh shell setup
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# Don't use the default CCACHE_DIR path on self-hosted runners
- name: Ccache prepare environment
run: |
$ccacheDirPath = Join-Path -Path '${{ runner.workspace }}' -ChildPath ccache
"CCACHE_DIR=$ccacheDirPath" >> $env:GITHUB_ENV
# I'm managing the ccache configuration manually on self-hosted runners using the ccache.conf
# because it's used by more actions.
- name: Ccache print version and configuration
run: |
Write-Output '::group::Print version'
ccache.exe --version
Write-Output '::endgroup::'
Write-Output '::group::Print ccache config'
ccache.exe --show-config
Write-Output '::endgroup::'
# Must be after the ilammy/msvc-dev-cmd@v1 because vcvars64 overrides the VCPKG_ROOT
- name: vcpkg prepare environment
run: |
"VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
'VCPKG_DEFAULT_TRIPLET=x64-windows' >> $env:GITHUB_ENV
'VCPKG_MAX_CONCURRENCY=2' >> $env:GITHUB_ENV
- name: Self-hosted runner prepare environment
run: |
'C:\Program Files\CMake\bin' >> $env:GITHUB_PATH
"$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_PATH
"$env:TINY_QT_ROOT\6.7.0\msvc2019_64\bin" >> $env:GITHUB_PATH
- name: CMake print version
run: |
cmake.exe --version
- name: vcpkg print version
run: |
vcpkg.exe --version
- name: TinyORM create build folder (TinyDrivers-msvc-${{ matrix.build-type.key }})
run: >-
$buildTreesPath =
'../TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}'
if (-not (Test-Path $buildTreesPath)) {
New-Item -Type Directory $buildTreesPath
}
- name: Ccache clear statistics
run: |
ccache.exe --zero-stats
- name: TinyORM cmake configure (TinyDrivers-msvc-${{ matrix.build-type.key }})
working-directory: ${{ env.TinyORMPath }}
run: >-
cmake.exe
-S .
-B '${{ runner.workspace }}/TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}'
-G Ninja
-D CMAKE_CXX_COMPILER_LAUNCHER:FILEPATH='C:/ProgramData/chocolatey/bin/ccache.exe'
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-D CMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON
-D CMAKE_EXPORT_PACKAGE_REGISTRY:BOOL=OFF
-D CMAKE_BUILD_TYPE:STRING=${{ matrix.build-type.name }}
-D CMAKE_CXX_SCAN_FOR_MODULES:BOOL=OFF
-D VCPKG_APPLOCAL_DEPS:BOOL=OFF
-D VERBOSE_CONFIGURE:BOOL=ON
-D MATCH_EQUAL_EXPORTED_BUILDTREE:BOOL=ON
-D MYSQL_PING:BOOL=ON
-D BUILD_TESTS:BOOL=ON
-D ORM:BOOL=ON
-D TOM:BOOL=ON
-D TOM_EXAMPLE:BOOL=ON
-D BUILD_DRIVERS:BOOL=ON
-D DRIVERS_TYPE:STRING=Shared
- name: TinyORM cmake build ✨ (TinyDrivers-msvc-${{ matrix.build-type.key }})
working-directory: >-
../TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}
run: |
cmake.exe --build . --target all --parallel ${{ env.TinyParallel }}
- name: Ccache print statistics
run: |
ccache.exe --show-stats -vv
# Used migrate:fresh instead (is safer)
- name: Create and Seed tables for unit tests 🎉
working-directory: >-
../TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}/tests/testdata_tom
run: |
$env:Path = '..\..;' + $env:Path
.\tom_testdata.exe migrate:fresh --database=tinyorm_testdata_tom_mysql --seed --no-ansi
env:
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }}
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }}
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }}
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST_SELF }}
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD_SELF }}
DB_MYSQL_SSL_CA: ${{ secrets.DB_MYSQL_DATA_SELF }}/ca.pem
DB_MYSQL_SSL_CERT: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-cert.pem
DB_MYSQL_SSL_KEY: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-key.pem
DB_MYSQL_SSL_MODE: ${{ secrets.DB_MYSQL_SSL_MODE }}
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF }}
TOM_TESTDATA_ENV: testing
- name: TinyORM execute ctest 🔥
working-directory: ../TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}
run: |
ctest.exe --output-on-failure
env:
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }}
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }}
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }}
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST_SELF }}
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD_SELF }}
DB_MYSQL_SSL_CA: ${{ secrets.DB_MYSQL_DATA_SELF }}/ca.pem
DB_MYSQL_SSL_CERT: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-cert.pem
DB_MYSQL_SSL_KEY: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-key.pem
DB_MYSQL_SSL_MODE: ${{ secrets.DB_MYSQL_SSL_MODE }}
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF }}
TOM_TESTS_ENV: testing
- name: Tom example test some commands (MySQL) 🚀
working-directory: >-
../TinyORM-builds-cmake/TinyDrivers-msvc-${{ matrix.build-type.key }}/examples/tom
run: |
$env:Path = '..\..;' + $env:Path
.\tom.exe migrate:reset --database=tinyorm_tom_mysql --no-ansi
.\tom.exe migrate:uninstall --reset --database=tinyorm_tom_mysql --no-ansi
.\tom.exe migrate:install --database=tinyorm_tom_mysql --no-ansi
.\tom.exe migrate:status --database=tinyorm_tom_mysql --no-ansi
.\tom.exe migrate --database=tinyorm_tom_mysql --seed --no-ansi
.\tom.exe migrate:refresh --database=tinyorm_tom_mysql --seed --no-ansi
.\tom.exe migrate:status --database=tinyorm_tom_mysql --no-ansi
env:
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }}
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }}
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }}
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST_SELF }}
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD_SELF }}
DB_MYSQL_SSL_CA: ${{ secrets.DB_MYSQL_DATA_SELF }}/ca.pem
DB_MYSQL_SSL_CERT: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-cert.pem
DB_MYSQL_SSL_KEY: ${{ secrets.DB_MYSQL_DATA_SELF }}/client-key.pem
DB_MYSQL_SSL_MODE: ${{ secrets.DB_MYSQL_SSL_MODE }}
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF }}
TOM_EXAMPLE_ENV: testing