MSVC2019 Qt5.15 #414
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL and PostgreSQL | |
# --- | |
# Both use the default unencrypted database connections. | |
name: MSVC2019 Qt5.15 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- gh-actions | |
jobs: | |
build: | |
name: cmake build / ctest | |
runs-on: windows-2019 | |
env: | |
# Settings (constant variables) | |
TINY_QT_VERSION: 5.15.2 | |
TINY_QT_SPEC: win64_msvc2019_64 | |
# First value is a compressed data size | |
# ~ 175 * 3 + 100 | |
TINY_CCACHE_MAX_SIZE: 650M | |
TINY_MYSQL_SERVICE: MySQL | |
TINY_POSTGRES_SERVICE: postgresql-x64-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: TinyORM prepare environment | |
run: | | |
$runnerWorkPath = Resolve-Path -Path "$env:RUNNER_WORKSPACE/.." | |
"TinyRunnerWorkPath=$runnerWorkPath" >> $env:GITHUB_ENV | |
$sqlitePath = Join-Path -Path $runnerWorkPath -ChildPath "SQLite/$env:DB_SQLITE_DATABASE" | |
"TinySQLitePath=$sqlitePath" >> $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 | |
$mysqlDataPath = Join-Path -Path $runnerWorkPath -ChildPath 'mysql/data' | |
"TinyMySQLDataPath=$mysqlDataPath" >> $env:GITHUB_ENV | |
"TinyParallel=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV | |
$tinyormBuildName = 'msvc-cmake-debug' | |
"TinyORMBuildName=$tinyormBuildName" >> $env:GITHUB_ENV | |
$tinyormBuildTree = Join-Path -Path $env:RUNNER_WORKSPACE TinyORM-builds-cmake ` | |
"build-$tinyormBuildName" | |
"TinyORMBuildTree=$tinyormBuildTree" >> $env:GITHUB_ENV | |
env: | |
DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} | |
- name: PostgreSQL add PGBIN on the $env:Path | |
run: | | |
$env:PGBIN >> $env:GITHUB_PATH | |
- name: PostgreSQL service start | |
run: | | |
Set-Service -Name $env:TINY_POSTGRES_SERVICE -StartupType Manual | |
Start-Service $env:TINY_POSTGRES_SERVICE | |
- name: PostgreSQL service check status | |
run: | | |
Write-Output '::group::Get-Service' | |
$pgsqlService = Get-Service $env:TINY_POSTGRES_SERVICE | |
Write-Output $pgsqlService | |
Write-Output '::endgroup::' | |
Write-Output '::group::Service running check' | |
$pgsqlService.status.ToString() -ceq 'Running' -or ` | |
$(throw "$env:TINY_POSTGRES_SERVICE service is not running") > $null | |
Write-Output '::endgroup::' | |
Write-Output '::group::pg_isready' | |
pg_isready.exe | |
Write-Output '::endgroup::' | |
- name: PostgreSQL create TinyORM user | |
run: >- | |
"create user `"$env:DB_PGSQL_USERNAME`" | |
with createdb password '$env:DB_PGSQL_PASSWORD';" | psql.exe | |
env: | |
DB_PGSQL_PASSWORD: ${{ secrets.DB_PGSQL_PASSWORD }} | |
DB_PGSQL_USERNAME: ${{ secrets.DB_PGSQL_USERNAME }} | |
- name: PostgreSQL create TinyORM database | |
run: | | |
createdb.exe --owner=$env:DB_PGSQL_USERNAME $env:DB_PGSQL_DATABASE | |
env: | |
DB_PGSQL_DATABASE: ${{ secrets.DB_PGSQL_DATABASE }} | |
DB_PGSQL_USERNAME: ${{ secrets.DB_PGSQL_USERNAME }} | |
- name: MySQL create data folder | |
run: | | |
New-Item -Type Directory $env:TinyMySQLDataPath | |
- name: MySQL initialize my.ini configuration | |
working-directory: .github/resources/windows | |
run: >- | |
(Get-Content -Path ./my_5.template.ini) -creplace | |
'\{MYSQL_DATADIR\}', $env:TinyMySQLDataPath -creplace | |
'\{MYSQL_HOST\}', $env:DB_MYSQL_HOST | | |
Set-Content -Path "$env:TinyMySQLInstallationPath/my.ini" | |
env: | |
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST }} | |
# The ConvertFrom-SecureString must be called on the [SecureString] instance to be able to | |
# store it in the environment or output variable | |
- name: MySQL initialize data directory | |
id: initializes-initialize-mysql-data-folder | |
run: >- | |
$regEx = '(?:\[Note\] A temporary password is generated for \w+@localhost: )(?<password>.+)' | |
$securedPassword = (mysqld.exe --initialize --console 2>&1 | | |
Select-String -Pattern $regEx).Matches[0].Groups['password'].Value | | |
ConvertTo-SecureString -AsPlainText | ConvertFrom-SecureString | |
"SecuredPassword=$securedPassword" >> $env:GITHUB_OUTPUT | |
- name: MySQL service install/start | |
run: | | |
mysqld.exe --install $env:TINY_MYSQL_SERVICE | |
Start-Service $env:TINY_MYSQL_SERVICE | |
# The secured_password is store in the string form so we have to re-create the [SecureString] | |
# from this encrypted string and then it can be decrypted as normally would π¬ | |
- name: MySQL change ${{ secrets.DB_MYSQL_ROOT_USERNAME }} password | |
run: >- | |
"alter user '$env:DB_MYSQL_ROOT_USERNAME'@'localhost' | |
identified by '$env:DB_MYSQL_ROOT_PASSWORD';" | | |
mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME | |
--password=$($env:secured_password | ConvertTo-SecureString | | |
ConvertFrom-SecureString -AsPlainText) | |
--connect-expired-password | |
env: | |
DB_MYSQL_ROOT_PASSWORD: ${{ secrets.DB_MYSQL_ROOT_PASSWORD }} | |
DB_MYSQL_ROOT_USERNAME: ${{ secrets.DB_MYSQL_ROOT_USERNAME }} | |
secured_password: ${{ steps.initializes-initialize-mysql-data-folder.outputs.SecuredPassword }} | |
- name: MySQL time zone POSIX tables initialize download | |
id: downloads-initialize-mysql-timezone-tables | |
run: | | |
$filename = (Split-Path -Path $env:URL_MYSQL_TIMEZONE_TABLES -Leaf) | |
"Filename=$filename" >> $env:GITHUB_OUTPUT | |
$filepath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $filename | |
"Filepath=$filepath" >> $env:GITHUB_OUTPUT | |
$basename = Split-Path -Path $filename -LeafBase | |
$extractedFolder = Join-Path -Path $env:RUNNER_TEMP -ChildPath $basename | |
"ExtractedFolder=$extractedFolder" >> $env:GITHUB_OUTPUT | |
"Hash=$basename" >> $env:GITHUB_OUTPUT | |
env: | |
URL_MYSQL_TIMEZONE_TABLES: ${{ secrets.URL_MYSQL_TIMEZONE_TABLES }} | |
- name: MySQL time zone POSIX tables restore cache (download) | |
uses: actions/cache@v4 | |
id: downloads-cache-mysql-timezone-tables | |
with: | |
path: ${{ env.extracted_folder }} | |
key: ${{ runner.os }}-databases-${{ env.cache_name }}-${{ env.cache_hash }} | |
env: | |
cache_hash: ${{ steps.downloads-initialize-mysql-timezone-tables.outputs.Hash }} | |
cache_name: mysql-timezone-tables | |
extracted_folder: ${{ steps.downloads-initialize-mysql-timezone-tables.outputs.ExtractedFolder }} | |
- name: MySQL time zone POSIX tables download | |
if: steps.downloads-cache-mysql-timezone-tables.outputs.cache-hit != 'true' | |
run: >- | |
Invoke-WebRequest -Uri $env:URL_MYSQL_TIMEZONE_TABLES -HttpVersion 2.0 | |
-MaximumRetryCount 3 -RetryIntervalSec 10 | | |
Select-Object -ExpandProperty Content | | |
Set-Content -Path $env:archive_filepath -AsByteStream | |
7z.exe x -y -o"$env:RUNNER_TEMP" "$env:archive_filepath" | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-mysql-timezone-tables.outputs.Filepath }} | |
URL_MYSQL_TIMEZONE_TABLES: ${{ secrets.URL_MYSQL_TIMEZONE_TABLES }} | |
- name: MySQL populate time zone tables π | |
run: >- | |
$filepath = Join-Path -Path $env:extracted_folder -ChildPath 'timezone_posix.sql' | |
# source path can't be quoted, it works correctly even with spaces | |
"source $filepath" | | |
mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD mysql | |
Restart-Service $env:TINY_MYSQL_SERVICE | |
env: | |
extracted_folder: ${{ steps.downloads-initialize-mysql-timezone-tables.outputs.ExtractedFolder }} | |
DB_MYSQL_ROOT_PASSWORD: ${{ secrets.DB_MYSQL_ROOT_PASSWORD }} | |
DB_MYSQL_ROOT_USERNAME: ${{ secrets.DB_MYSQL_ROOT_USERNAME }} | |
- name: MySQL service check status | |
run: | | |
Write-Output '::group::Get-Service' | |
$mysqlService = Get-Service $env:TINY_MYSQL_SERVICE | |
Write-Output $mysqlService | |
Write-Output '::endgroup::' | |
Write-Output '::group::Service running check' | |
$mysqlService.status.ToString() -ceq 'Running' -or ` | |
$(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null | |
Write-Output '::endgroup::' | |
Write-Output '::group::Ping' | |
mysqladmin.exe --user=$env:DB_MYSQL_ROOT_USERNAME ` | |
--password=$env:DB_MYSQL_ROOT_PASSWORD ping | |
Write-Output '::endgroup::' | |
env: | |
DB_MYSQL_ROOT_PASSWORD: ${{ secrets.DB_MYSQL_ROOT_PASSWORD }} | |
DB_MYSQL_ROOT_USERNAME: ${{ secrets.DB_MYSQL_ROOT_USERNAME }} | |
- name: MySQL create TinyORM database | |
run: >- | |
"create database if not exists ``$env:DB_MYSQL_DATABASE`` | |
default character set $env:DB_MYSQL_CHARSET | |
default collate $env:DB_MYSQL_COLLATION;" | | |
mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD | |
env: | |
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} | |
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_57_COLLATION }} | |
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }} | |
DB_MYSQL_ROOT_PASSWORD: ${{ secrets.DB_MYSQL_ROOT_PASSWORD }} | |
DB_MYSQL_ROOT_USERNAME: ${{ secrets.DB_MYSQL_ROOT_USERNAME }} | |
# I had to assign the SUPER privilege to be able set global `max_allowed_packet` for tst_blobs, | |
# it looks like it's only needed for MySQL v5.7, on MySQL v8 isn't needed, also, the SUPER | |
# privilege can't be assigned to the table eg. tinyorm_% because it's a global privilege so | |
# * have to be used. | |
- name: MySQL create TinyORM user | |
run: >- | |
"create user '$env:DB_MYSQL_USERNAME'@'%' | |
identified by '$env:DB_MYSQL_PASSWORD'; | |
grant all privileges on ``tinyorm\_%``.* to '$env:DB_MYSQL_USERNAME'@'%'; | |
grant super on *.* to '$env:DB_MYSQL_USERNAME'@'%'; | |
grant select on ``mysql``.``time_zone_name`` to '$env:DB_MYSQL_USERNAME'@'%'; | |
flush privileges;" | | |
mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD | |
env: | |
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD }} | |
DB_MYSQL_ROOT_PASSWORD: ${{ secrets.DB_MYSQL_ROOT_PASSWORD }} | |
DB_MYSQL_ROOT_USERNAME: ${{ secrets.DB_MYSQL_ROOT_USERNAME }} | |
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME }} | |
- 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: SQLite create TinyORM database | |
run: | | |
New-Item -Type Directory (Split-Path -Path $env:TinySQLitePath -Parent) | |
New-Item -Type File -Path $env:TinySQLitePath | |
# Windows github hosted runners don't contain sqlite3 executable | |
- name: Print MySQL and PostgreSQL database versions | |
run: | | |
Write-Output '::group::MySQL version' | |
mysql.exe --version | |
Write-Output '::endgroup::' | |
Write-Output '::group::PostgreSQL version' | |
postgres.exe --version | |
Write-Output '::endgroup::' | |
- name: Qt ${{ env.TINY_QT_VERSION }} install base components | |
uses: jurplel/install-qt-action@v3 | |
with: | |
archives: qtbase | |
version: ${{ env.TINY_QT_VERSION }} | |
arch: ${{ env.TINY_QT_SPEC }} | |
cache: true | |
setup-python: false | |
extra: --external 7z.exe | |
dir: ${{ env.TinyRunnerWorkPath }} | |
- name: QMYSQL driver dlls initialize download (Qt ${{ env.TINY_QT_VERSION }}) | |
id: downloads-initialize-qmysql-dlls | |
run: | | |
$filename = (Split-Path -Path $env:URL_QMYSQL_DLLS_MSVC_X64_QT_5 -Leaf) | |
"Filename=$filename" >> $env:GITHUB_OUTPUT | |
$filepath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $filename | |
"Filepath=$filepath" >> $env:GITHUB_OUTPUT | |
$response = Invoke-WebRequest -Uri $env:URL_CACHE_HASH_WINDOWS | |
"Hash=$($response.Content)" >> $env:GITHUB_OUTPUT | |
env: | |
URL_QMYSQL_DLLS_MSVC_X64_QT_5: ${{ secrets.URL_QMYSQL_DLLS_MSVC_X64_QT_5 }} | |
URL_CACHE_HASH_WINDOWS: ${{ secrets.URL_CACHE_HASH_WINDOWS }} | |
- name: QMYSQL driver dlls restore cache (download) | |
uses: actions/cache@v4 | |
id: downloads-cache-qmysql-dlls | |
with: | |
path: ${{ env.archive_filepath }} | |
key: ${{ runner.os }}-drivers-${{ env.cache_name }}-${{ env.cache_hash }} | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-qmysql-dlls.outputs.Filepath }} | |
cache_hash: ${{ steps.downloads-initialize-qmysql-dlls.outputs.Hash }} | |
cache_name: qmysql-dlls-qt5 | |
- name: QMYSQL driver dlls download (Qt ${{ env.TINY_QT_VERSION }}) | |
if: steps.downloads-cache-qmysql-dlls.outputs.cache-hit != 'true' | |
run: >- | |
$response = Invoke-WebRequest -Uri $env:URL_QMYSQL_DLLS_MSVC_X64_QT_5 | |
$response | Select-Object -ExpandProperty Content | | |
Set-Content -Path $env:archive_filepath -AsByteStream | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-qmysql-dlls.outputs.Filepath }} | |
URL_QMYSQL_DLLS_MSVC_X64_QT_5: ${{ secrets.URL_QMYSQL_DLLS_MSVC_X64_QT_5 }} | |
- name: QMYSQL driver dlls install (Qt ${{ env.TINY_QT_VERSION }}) | |
run: | | |
7z.exe x -y -o"$env:QT_PLUGIN_PATH/sqldrivers" $env:archive_filepath | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-qmysql-dlls.outputs.Filepath }} | |
- name: MySQL 8 libmysql.dll initialize download (Qt ${{ env.TINY_QT_VERSION }}) | |
id: downloads-initialize-mysql_8-libmysql-dll | |
run: | | |
$filename = (Split-Path -Path $env:URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5 -Leaf) | |
"Filename=$filename" >> $env:GITHUB_OUTPUT | |
$filepath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $filename | |
"Filepath=$filepath" >> $env:GITHUB_OUTPUT | |
$response = Invoke-WebRequest -Uri $env:URL_CACHE_HASH_WINDOWS | |
"Hash=$($response.Content)" >> $env:GITHUB_OUTPUT | |
env: | |
URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5: ${{ secrets.URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5 }} | |
URL_CACHE_HASH_WINDOWS: ${{ secrets.URL_CACHE_HASH_WINDOWS }} | |
- name: MySQL 8 libmysql.dll restore cache | |
uses: actions/cache@v4 | |
id: downloads-cache-mysql_8-libmysql-dll | |
with: | |
path: ${{ env.archive_filepath }} | |
key: ${{ runner.os }}-drivers-${{ env.cache_name }}-${{ env.cache_hash }} | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-mysql_8-libmysql-dll.outputs.Filepath }} | |
cache_hash: ${{ steps.downloads-initialize-mysql_8-libmysql-dll.outputs.Hash }} | |
cache_name: mysql_8-libmysql-dll | |
- name: MySQL 8 libmysql.dll download (Qt ${{ env.TINY_QT_VERSION }}) | |
if: steps.downloads-cache-mysql_8-libmysql-dll.outputs.cache-hit != 'true' | |
run: | | |
$response = Invoke-WebRequest -Uri $env:URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5 | |
$response | Select-Object -ExpandProperty Content | | |
Set-Content -Path $env:archive_filepath -AsByteStream | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-mysql_8-libmysql-dll.outputs.Filepath }} | |
URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5: ${{ secrets.URL_LIBMYSQL_DLL_MYSQL_8_MSVC_X64_QT_5 }} | |
- name: MySQL 8 libmysql.dll install (Qt ${{ env.TINY_QT_VERSION }}) | |
run: | | |
7z.exe x -y -o"$env:TinyRunnerWorkPath/TinyORM-bin" $env:archive_filepath | |
env: | |
archive_filepath: ${{ steps.downloads-initialize-mysql_8-libmysql-dll.outputs.Filepath }} | |
- name: MySQL 8 libmysql.dll add on the $env:Path | |
run: | | |
"$env:TinyRunnerWorkPath\TinyORM-bin" >> $env:GITHUB_PATH | |
- name: Ccache initialize | |
id: ccache-initialize-cache | |
run: | | |
Write-Output '::group::Install' | |
choco.exe install ccache --yes | |
Write-Output '::endgroup::' | |
Write-Output '::group::get-config cache_dir' | |
$cachePath = ccache.exe --get-config cache_dir | |
"CachePath=$cachePath" >> $env:GITHUB_OUTPUT | |
"ImageOS=$env:ImageOS" >> $env:GITHUB_OUTPUT | |
Write-Output '::endgroup::' | |
- name: Ccache restore cache πΊ | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.cache_path }} | |
key: ${{ runner.os }}-${{ env.image_os }}-ccache-${{ env.cache_name }}-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.image_os }}-ccache-${{ env.cache_name }}- | |
env: | |
cache_name: msvc2019-qt5 | |
cache_path: ${{ steps.ccache-initialize-cache.outputs.CachePath }} | |
image_os: ${{ steps.ccache-initialize-cache.outputs.ImageOS }} | |
- name: Ccache prepare configuration π₯³ | |
run: | | |
ccache.exe --set-config max_size=$env:TINY_CCACHE_MAX_SIZE | |
ccache.exe --set-config sloppiness=pch_defines,time_macros | |
ccache.exe --set-config depend_mode=true | |
ccache.exe --set-config inode_cache=true | |
- 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::' | |
- name: Visual Studio 2019 pwsh shell setup | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
# 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=$env:TinyParallel" >> $env:GITHUB_ENV | |
- name: CMake print version | |
run: | | |
cmake.exe --version | |
- name: Ccache clear statistics | |
run: | | |
ccache.exe --zero-stats | |
- name: TinyORM cmake configure (${{ env.TinyORMBuildName }}) | |
run: >- | |
cmake.exe --log-level=DEBUG --log-context | |
-S . | |
-B $env:TinyORMBuildTree | |
-G Ninja | |
-D CMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=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=Debug | |
-D CMAKE_CXX_SCAN_FOR_MODULES:BOOL=OFF | |
-D VCPKG_APPLOCAL_DEPS:BOOL=OFF | |
-D VERBOSE_CONFIGURE:BOOL=ON | |
-D BUILD_TREE_DEPLOY:BOOL=OFF | |
-D MATCH_EQUAL_EXPORTED_BUILDTREE:BOOL=OFF | |
-D STRICT_MODE:BOOL=OFF | |
-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=OFF | |
- name: TinyORM cmake build β¨ (${{ env.TinyORMBuildName }}) | |
working-directory: ${{ env.TinyORMBuildTree }} | |
run: | | |
cmake.exe --build . --target all --parallel $env:TinyParallel | |
- name: Ccache print statistics | |
run: | | |
ccache.exe --show-stats --verbose | |
- name: TinyORM add on the $env:Path | |
run: | | |
$env:TinyORMBuildTree >> $env:GITHUB_PATH | |
- name: Create and Seed tables for unit tests π | |
working-directory: ${{ env.TinyORMBuildTree }}/tests/testdata_tom | |
run: >- | |
.\tom_testdata.exe migrate | |
--database=tinyorm_testdata_tom_mysql,tinyorm_testdata_tom_postgres,tinyorm_testdata_tom_sqlite | |
--seed --no-ansi | |
env: | |
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} | |
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_57_COLLATION }} | |
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }} | |
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST }} | |
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD }} | |
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME }} | |
DB_PGSQL_CHARSET: ${{ secrets.DB_PGSQL_CHARSET }} | |
DB_PGSQL_DATABASE: ${{ secrets.DB_PGSQL_DATABASE }} | |
DB_PGSQL_HOST: ${{ secrets.DB_PGSQL_HOST }} | |
DB_PGSQL_PASSWORD: ${{ secrets.DB_PGSQL_PASSWORD }} | |
DB_PGSQL_SEARCHPATH: ${{ secrets.DB_PGSQL_SEARCHPATH }} | |
DB_PGSQL_USERNAME: ${{ secrets.DB_PGSQL_USERNAME }} | |
DB_SQLITE_DATABASE: ${{ env.TinySQLitePath }} | |
TOM_TESTDATA_ENV: ${{ vars.TOM_TESTDATA_ENV }} | |
# $env:NUMBER_OF_PROCESSORS / 2 : rounds down | |
- name: TinyORM execute ctest π₯ | |
working-directory: ${{ env.TinyORMBuildTree }} | |
run: >- | |
ctest.exe --output-on-failure | |
--parallel ([int] $env:TinyParallel + $env:NUMBER_OF_PROCESSORS / 2) | |
env: | |
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} | |
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_57_COLLATION }} | |
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }} | |
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST }} | |
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD }} | |
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME }} | |
DB_PGSQL_CHARSET: ${{ secrets.DB_PGSQL_CHARSET }} | |
DB_PGSQL_DATABASE: ${{ secrets.DB_PGSQL_DATABASE }} | |
DB_PGSQL_HOST: ${{ secrets.DB_PGSQL_HOST }} | |
DB_PGSQL_PASSWORD: ${{ secrets.DB_PGSQL_PASSWORD }} | |
DB_PGSQL_SEARCHPATH: ${{ secrets.DB_PGSQL_SEARCHPATH }} | |
DB_PGSQL_USERNAME: ${{ secrets.DB_PGSQL_USERNAME }} | |
DB_SQLITE_DATABASE: ${{ env.TinySQLitePath }} | |
TOM_TESTS_ENV: ${{ vars.TOM_TESTS_ENV }} | |
- name: Tom example test some commands (MySQL) π | |
working-directory: ${{ env.TinyORMBuildTree }}/examples/tom | |
run: | | |
.\tom.exe migrate:fresh --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 --database=tinyorm_tom_mysql --seed --no-ansi | |
.\tom.exe migrate:status --database=tinyorm_tom_mysql --no-ansi | |
.\tom.exe migrate:refresh --database=tinyorm_tom_mysql --seed --no-ansi | |
.\tom.exe migrate:reset --database=tinyorm_tom_mysql --no-ansi | |
.\tom.exe migrate:uninstall --database=tinyorm_tom_mysql --no-ansi | |
env: | |
DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} | |
DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_57_COLLATION }} | |
DB_MYSQL_DATABASE: ${{ secrets.DB_MYSQL_DATABASE }} | |
DB_MYSQL_HOST: ${{ secrets.DB_MYSQL_HOST }} | |
DB_MYSQL_PASSWORD: ${{ secrets.DB_MYSQL_PASSWORD }} | |
DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME }} | |
TOM_EXAMPLE_ENV: ${{ vars.TOM_EXAMPLE_ENV }} | |
- name: Tom example test some commands (PostgreSQL) π | |
working-directory: ${{ env.TinyORMBuildTree }}/examples/tom | |
run: | | |
.\tom.exe migrate:fresh --database=tinyorm_tom_postgres --no-ansi | |
.\tom.exe migrate:uninstall --reset --database=tinyorm_tom_postgres --no-ansi | |
.\tom.exe migrate:install --database=tinyorm_tom_postgres --no-ansi | |
.\tom.exe migrate --database=tinyorm_tom_postgres --seed --no-ansi | |
.\tom.exe migrate:status --database=tinyorm_tom_postgres --no-ansi | |
.\tom.exe migrate:refresh --database=tinyorm_tom_postgres --seed --no-ansi | |
.\tom.exe migrate:reset --database=tinyorm_tom_postgres --no-ansi | |
.\tom.exe migrate:uninstall --database=tinyorm_tom_postgres --no-ansi | |
env: | |
DB_PGSQL_CHARSET: ${{ secrets.DB_PGSQL_CHARSET }} | |
DB_PGSQL_DATABASE: ${{ secrets.DB_PGSQL_DATABASE }} | |
DB_PGSQL_HOST: ${{ secrets.DB_PGSQL_HOST }} | |
DB_PGSQL_PASSWORD: ${{ secrets.DB_PGSQL_PASSWORD }} | |
DB_PGSQL_SEARCHPATH: ${{ secrets.DB_PGSQL_SEARCHPATH }} | |
DB_PGSQL_USERNAME: ${{ secrets.DB_PGSQL_USERNAME }} | |
TOM_EXAMPLE_ENV: ${{ vars.TOM_EXAMPLE_ENV }} | |
- name: Tom example test some commands (SQLite) π | |
working-directory: ${{ env.TinyORMBuildTree }}/examples/tom | |
run: | | |
.\tom.exe migrate:fresh --database=tinyorm_tom_sqlite --no-ansi | |
.\tom.exe migrate:uninstall --reset --database=tinyorm_tom_sqlite --no-ansi | |
.\tom.exe migrate:install --database=tinyorm_tom_sqlite --no-ansi | |
.\tom.exe migrate --database=tinyorm_tom_sqlite --seed --no-ansi | |
.\tom.exe migrate:status --database=tinyorm_tom_sqlite --no-ansi | |
.\tom.exe migrate:refresh --database=tinyorm_tom_sqlite --seed --no-ansi | |
.\tom.exe migrate:reset --database=tinyorm_tom_sqlite --no-ansi | |
.\tom.exe migrate:uninstall --database=tinyorm_tom_sqlite --no-ansi | |
env: | |
DB_SQLITE_DATABASE: ${{ env.TinySQLitePath }} | |
TOM_EXAMPLE_ENV: ${{ vars.TOM_EXAMPLE_ENV }} |