From 0ddc830b01ed5cf34bef04e3087cf129dc81e441 Mon Sep 17 00:00:00 2001 From: silverqx Date: Tue, 11 Jun 2024 01:29:05 +0200 Subject: [PATCH] workflows extracted everything to env. variables For easier updates and to minimize replace points/locations. --- .github/workflows/clang-cl-qt6.yml | 46 +++++++------- .github/workflows/linux-qt5.yml | 38 +++++++++--- .github/workflows/linux-qt6.yml | 38 +++++++++--- .github/workflows/msvc2019-qt5.yml | 68 ++++++++++++--------- .github/workflows/msvc2022-qt6-drivers.yml | 29 +++++---- .github/workflows/msvc2022-qt6.yml | 52 +++++++++------- .github/workflows/msys2-ucrt64-drivers.yml | 37 ++++++----- .github/workflows/msys2-ucrt64.yml | 51 ++++++++++------ .github/workflows/vcpkg-windows-drivers.yml | 22 +++---- .github/workflows/vcpkg-windows.yml | 15 +++-- 10 files changed, 244 insertions(+), 152 deletions(-) diff --git a/.github/workflows/clang-cl-qt6.yml b/.github/workflows/clang-cl-qt6.yml index b3d38800c..45bb82424 100644 --- a/.github/workflows/clang-cl-qt6.yml +++ b/.github/workflows/clang-cl-qt6.yml @@ -29,6 +29,11 @@ jobs: env: TINY_QT_VERSION: 6.7.1 TINY_QT_SPEC: msvc2019_64 + TINY_LLVM_VERSION: 18.1.7 + # Initial build size 1.4G :/ + TINY_CCACHE_MAX_SIZE: 2G + TINY_MYSQL_SERVICE: MySQL + TINY_POSTGRES_SERVICE: postgresql-x64-14 steps: - uses: actions/checkout@v4 @@ -47,6 +52,8 @@ jobs: $mysqlDataPath = Join-Path -Path $runnerWorkPath -ChildPath 'mysql/data' "TinyMySQLDataPath=$mysqlDataPath" >> $env:GITHUB_ENV + + "TinyParallel=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} @@ -173,8 +180,8 @@ jobs: - name: PostgreSQL service start run: | - Set-Service -Name postgresql-x64-14 -StartupType Manual - Start-Service postgresql-x64-14 + Set-Service -Name $env:TINY_POSTGRES_SERVICE -StartupType Manual + Start-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL change ${{ secrets.DB_PGSQL_ROOT_USERNAME }} password run: >- @@ -227,20 +234,18 @@ jobs: - name: PostgreSQL service restart run: | - Restart-Service postgresql-x64-14 + Restart-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL service check status run: | - $serviceName = 'postgresql-x64-14' - Write-Output '::group::Get-Service' - $pgsqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_POSTGRES_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::pg_isready' @@ -395,8 +400,8 @@ jobs: - name: MySQL service install/start run: | - mysqld.exe --install MySQL - Start-Service MySQL + mysqld.exe --install $env:TINY_MYSQL_SERVICE + Start-Service $env:TINY_MYSQL_SERVICE # Securing the root account even on localhost is for testing to make sure that everything # works as expected @@ -470,7 +475,7 @@ jobs: "source $filepath" | mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD mysql - Restart-Service 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 }} @@ -478,16 +483,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::Ping' @@ -615,10 +618,10 @@ jobs: C:/Program Files/LLVM key: llvm-18.1.7 - - name: Install LLVM and Clang 18.1.7 + - name: Install LLVM and Clang ${{ env.TINY_LLVM_VERSION }} uses: KyleMayes/install-llvm-action@v1 with: - version: 18.1.7 + version: ${{ env.TINY_LLVM_VERSION }} force-version: true cached: ${{ steps.llvm-cache.outputs.cache-hit }} @@ -650,8 +653,7 @@ jobs: - name: Ccache prepare configuration 🥳 run: | - # Initial build size 1.4G :/ - ccache.exe --set-config max_size=2G + 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 @@ -714,7 +716,7 @@ jobs: - name: TinyORM cmake build ✨ (clang-cl-cmake-debug) run: >- cmake.exe --build ../TinyORM-builds-cmake/build-clang-cl-cmake-debug --target all - --parallel 2 + --parallel $env:TinyParallel - name: Ccache print statistics run: | @@ -749,10 +751,12 @@ jobs: 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: ../TinyORM-builds-cmake/build-clang-cl-cmake-debug - run: | - ctest.exe --output-on-failure --parallel 4 + 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_COLLATION }} diff --git a/.github/workflows/linux-qt5.yml b/.github/workflows/linux-qt5.yml index 83d6ef87c..a203e3246 100644 --- a/.github/workflows/linux-qt5.yml +++ b/.github/workflows/linux-qt5.yml @@ -18,6 +18,17 @@ jobs: runs-on: ubuntu-24.04 + env: + # This number must also be changed in the matrix as env context can't be used in the matrix + TINY_LLVM_VERSION: 18 + TINY_LLVM_APT_NAME: noble + # First value is a compressed data size + # gcc: ~ 115 * 3 + 100 ; clang: ~ 90 * 3 + 100 + TINY_CCACHE_MAX_SIZE_GCC: 450M + TINY_CCACHE_MAX_SIZE_CLANG: 380M + # Clang and vcpkg use $(nproc --all) (max. available cores) + TINY_PARALLEL_GCC: 2 + strategy: matrix: compiler: @@ -41,6 +52,16 @@ jobs: sqlitePath="$runnerWorkPath/SQLite/$DB_SQLITE_DATABASE" echo "TinySQLitePath=$sqlitePath" >> $GITHUB_ENV + + [[ '${{ matrix.compiler.key }}' == 'gcc' ]] && ccacheMaxSize="$TINY_CCACHE_MAX_SIZE_GCC" \ + || ccacheMaxSize="$TINY_CCACHE_MAX_SIZE_CLANG" + echo "TinyCcacheMaxSize=$ccacheMaxSize" >> $GITHUB_ENV + + [[ '${{ matrix.compiler.key }}' == 'gcc' ]] && parallel=$TINY_PARALLEL_GCC \ + || parallel=$(nproc --all) + echo "TinyParallel=$parallel" >> $GITHUB_ENV + + echo "TinyParallelVcpkg=$(nproc --all)" >> $GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} @@ -174,14 +195,15 @@ jobs: sqlite3 --version echo '::endgroup::' - - name: add-apt-repository Clang 18 + - name: add-apt-repository Clang ${{ env.TINY_LLVM_VERSION }} if: matrix.compiler.key == 'clang' run: >- wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | - sudo tee /etc/apt/trusted.gpg.d/llvm-18.asc > /dev/null + sudo tee /etc/apt/trusted.gpg.d/llvm-${{ env.TINY_LLVM_VERSION }}.asc > /dev/null sudo add-apt-repository --yes - --sourceslist 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main' + --sourceslist 'deb http://apt.llvm.org/${{ env.TINY_LLVM_APT_NAME }}/ + llvm-toolchain-${{ env.TINY_LLVM_APT_NAME }}-${{ env.TINY_LLVM_VERSION }} main' - name: apt update run: | @@ -220,9 +242,7 @@ jobs: - name: Ccache prepare configuration 🥳 run: | - # First value is a compressed data size - # gcc: ~ 115 * 3 + 100 ; clang: ~ 90 * 3 + 100 - ccache --set-config max_size=${{ matrix.compiler.key == 'gcc' && '450M' || '380M' }} + ccache --set-config max_size="$TinyCcacheMaxSize" ccache --set-config sloppiness=pch_defines,time_macros ccache --show-config @@ -240,7 +260,7 @@ jobs: run: | echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV echo 'VCPKG_DEFAULT_TRIPLET=x64-linux-dynamic' >> $GITHUB_ENV - echo 'VCPKG_MAX_CONCURRENCY=2' >> $GITHUB_ENV + echo "VCPKG_MAX_CONCURRENCY=$TinyParallelVcpkg" >> $GITHUB_ENV - name: CMake print version run: | @@ -283,7 +303,7 @@ jobs: - name: TinyORM cmake build ✨ (${{ matrix.compiler.name }}-cmake-debug) run: >- cmake --build ../TinyORM-builds-cmake/build-${{ matrix.compiler.name }}-cmake-debug - --target all --parallel 2 + --target all --parallel $TinyParallel - name: Ccache print statistics run: | @@ -316,7 +336,7 @@ jobs: - name: TinyORM execute ctest 🔥 working-directory: ../TinyORM-builds-cmake/build-${{ matrix.compiler.name }}-cmake-debug run: | - ctest --output-on-failure --parallel 4 + ctest --output-on-failure --parallel $(($TinyParallel + $(nproc --all) / 2)) env: DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }} diff --git a/.github/workflows/linux-qt6.yml b/.github/workflows/linux-qt6.yml index 9cb8038f5..4594f1485 100644 --- a/.github/workflows/linux-qt6.yml +++ b/.github/workflows/linux-qt6.yml @@ -27,6 +27,17 @@ jobs: runs-on: ubuntu-24.04 + env: + # This number must also be changed in the matrix as env context can't be used in the matrix + TINY_LLVM_VERSION: 18 + TINY_LLVM_APT_NAME: noble + # First value is a compressed data size + # gcc: ~ 165 * 3 + 100 ; clang: ~ 100 * 3 + 100 + TINY_CCACHE_MAX_SIZE_GCC: 600M + TINY_CCACHE_MAX_SIZE_CLANG: 400M + # Clang and vcpkg use $(nproc --all) (max. available cores) + TINY_PARALLEL_GCC: 2 + strategy: matrix: compiler: @@ -50,6 +61,16 @@ jobs: sqlitePath="$runnerWorkPath/SQLite/$DB_SQLITE_DATABASE" echo "TinySQLitePath=$sqlitePath" >> $GITHUB_ENV + + [[ '${{ matrix.compiler.key }}' == 'gcc' ]] && ccacheMaxSize="$TINY_CCACHE_MAX_SIZE_GCC" \ + || ccacheMaxSize="$TINY_CCACHE_MAX_SIZE_CLANG" + echo "TinyCcacheMaxSize=$ccacheMaxSize" >> $GITHUB_ENV + + [[ '${{ matrix.compiler.key }}' == 'gcc' ]] && parallel=$TINY_PARALLEL_GCC \ + || parallel=$(nproc --all) + echo "TinyParallel=$parallel" >> $GITHUB_ENV + + echo "TinyParallelVcpkg=$(nproc --all)" >> $GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} @@ -534,14 +555,15 @@ jobs: sqlite3 --version echo '::endgroup::' - - name: add-apt-repository Clang 18 + - name: add-apt-repository Clang ${{ env.TINY_LLVM_VERSION }} if: matrix.compiler.key == 'clang' run: >- wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | - sudo tee /etc/apt/trusted.gpg.d/llvm-18.asc > /dev/null + sudo tee /etc/apt/trusted.gpg.d/llvm-${{ env.TINY_LLVM_VERSION }}.asc > /dev/null sudo add-apt-repository --yes - --sourceslist 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main' + --sourceslist 'deb http://apt.llvm.org/${{ env.TINY_LLVM_APT_NAME }}/ + llvm-toolchain-${{ env.TINY_LLVM_APT_NAME }}-${{ env.TINY_LLVM_VERSION }} main' - name: apt update run: | @@ -580,9 +602,7 @@ jobs: - name: Ccache prepare configuration 🥳 run: | - # First value is a compressed data size - # gcc: ~ 165 * 3 + 100 ; clang: ~ 100 * 3 + 100 - ccache --set-config max_size=${{ matrix.compiler.key == 'gcc' && '600M' || '400M' }} + ccache --set-config max_size="$TinyCcacheMaxSize" ccache --set-config sloppiness=pch_defines,time_macros - name: Ccache print version and configuration @@ -599,7 +619,7 @@ jobs: run: | echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV echo 'VCPKG_DEFAULT_TRIPLET=x64-linux-dynamic' >> $GITHUB_ENV - echo 'VCPKG_MAX_CONCURRENCY=2' >> $GITHUB_ENV + echo "VCPKG_MAX_CONCURRENCY=$TinyParallelVcpkg" >> $GITHUB_ENV - name: CMake print version run: | @@ -642,7 +662,7 @@ jobs: - name: TinyORM cmake build ✨ (${{ matrix.compiler.name }}-cmake-debug) run: >- cmake --build ../TinyORM-builds-cmake/build-${{ matrix.compiler.name }}-cmake-debug - --target all --parallel 2 + --target all --parallel $TinyParallel - name: Ccache print statistics run: | @@ -679,7 +699,7 @@ jobs: - name: TinyORM execute ctest 🔥 working-directory: ../TinyORM-builds-cmake/build-${{ matrix.compiler.name }}-cmake-debug run: | - ctest --output-on-failure --parallel 4 + ctest --output-on-failure --parallel $(($TinyParallel + $(nproc --all) / 2)) env: DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }} diff --git a/.github/workflows/msvc2019-qt5.yml b/.github/workflows/msvc2019-qt5.yml index 85713da75..d7e7342fa 100644 --- a/.github/workflows/msvc2019-qt5.yml +++ b/.github/workflows/msvc2019-qt5.yml @@ -18,6 +18,15 @@ jobs: runs-on: windows-2019 + env: + 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 @@ -35,6 +44,8 @@ jobs: $mysqlDataPath = Join-Path -Path $runnerWorkPath -ChildPath 'mysql/data' "TinyMySQLDataPath=$mysqlDataPath" >> $env:GITHUB_ENV + + "TinyParallel=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} @@ -44,21 +55,19 @@ jobs: - name: PostgreSQL service start run: | - Set-Service -Name postgresql-x64-14 -StartupType Manual - Start-Service postgresql-x64-14 + Set-Service -Name $env:TINY_POSTGRES_SERVICE -StartupType Manual + Start-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL service check status run: | - $serviceName = 'postgresql-x64-14' - Write-Output '::group::Get-Service' - $pgsqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_POSTGRES_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::pg_isready' @@ -109,8 +118,8 @@ jobs: - name: MySQL service install/start run: | - mysqld.exe --install MySQL - Start-Service MySQL + 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 😬 @@ -178,7 +187,7 @@ jobs: "source $filepath" | mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD mysql - Restart-Service 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 }} @@ -186,16 +195,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::Ping' @@ -262,18 +269,18 @@ jobs: postgres.exe --version Write-Output '::endgroup::' - - name: Qt 5.15.2 install base components + - name: Qt ${{ env.TINY_QT_VERSION }} install base components uses: jurplel/install-qt-action@v3 with: archives: qtbase - version: 5.15.2 - arch: win64_msvc2019_64 + 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 5.15.2) + - 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) @@ -299,7 +306,7 @@ jobs: cache_hash: ${{ steps.downloads-initialize-qmysql-dlls.outputs.Hash }} cache_name: qmysql-dlls-qt5 - - name: QMYSQL driver dlls download (Qt 5.15.2) + - 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 @@ -310,13 +317,13 @@ jobs: 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 5.15.2) + - 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 5.15.2) + - 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) @@ -342,7 +349,7 @@ jobs: cache_hash: ${{ steps.downloads-initialize-mysql_8-libmysql-dll.outputs.Hash }} cache_name: mysql_8-libmysql-dll - - name: MySQL 8 libmysql.dll download (Qt 5.15.2) + - 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 @@ -353,7 +360,7 @@ jobs: 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 5.15.2) + - 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: @@ -391,9 +398,7 @@ jobs: - name: Ccache prepare configuration 🥳 run: | - # First value is compressed data size - # ~ 175 * 3 + 100 - ccache.exe --set-config max_size=650M + 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 @@ -418,7 +423,7 @@ jobs: 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 + "VCPKG_MAX_CONCURRENCY=$env:TinyParallel" >> $env:GITHUB_ENV - name: CMake print version run: | @@ -458,8 +463,9 @@ jobs: -D BUILD_DRIVERS:BOOL=OFF - name: TinyORM cmake build ✨ (msvc-cmake-debug) - run: | - cmake.exe --build ../TinyORM-builds-cmake/build-msvc-cmake-debug --target all --parallel 2 + run: >- + cmake.exe --build ../TinyORM-builds-cmake/build-msvc-cmake-debug --target all + --parallel $env:TinyParallel - name: Ccache print statistics run: | @@ -489,10 +495,12 @@ jobs: 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: ../TinyORM-builds-cmake/build-msvc-cmake-debug - run: | - ctest.exe --output-on-failure --parallel 4 + 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 }} diff --git a/.github/workflows/msvc2022-qt6-drivers.yml b/.github/workflows/msvc2022-qt6-drivers.yml index efb149e14..6d4e31a4e 100644 --- a/.github/workflows/msvc2022-qt6-drivers.yml +++ b/.github/workflows/msvc2022-qt6-drivers.yml @@ -30,6 +30,12 @@ jobs: # Self-hosted runner is Windows 11 (Release Preview channel - 24H2) runs-on: [ self-hosted, windows ] + env: + TINY_QT_VERSION: 6.7.1 + TINY_QT_SPEC: win64_msvc2019_64 + TINY_MYSQL_SERVICE: MySQL84 + TINY_PARALLEL: 10 + strategy: matrix: lto: [ OFF ] @@ -64,8 +70,6 @@ jobs: $mysqlInstallationPath = Split-Path -Parent -Path (Split-Path -Parent -Path $mysqlExePath) "TinyMySQLInstallationPath=$mysqlInstallationPath" >> $env:GITHUB_ENV - "TinyParallel=10" >> $env:GITHUB_ENV - $tinyormPath = Resolve-Path -Path ./main "TinyORMPath=$tinyormPath" >> $env:GITHUB_ENV @@ -78,6 +82,9 @@ jobs: $tinyormBuildFolder "TinyORMBuildTree=$tinyormBuildTree" >> $env:GITHUB_ENV + $qtSpecPlain = $env:TINY_QT_SPEC.Split('_')[1..$env:TINY_QT_SPEC.Count] -join '_' + "TinyQtSpecPlain=$qtSpecPlain" >> $env:GITHUB_ENV + - name: MySQL add libmysql.dll on the $env:Path, INCLUDE, and LIB run: | "$env:TinyMySQLInstallationPath\lib" >> $env:GITHUB_PATH @@ -87,16 +94,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL84' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' # .mylogin.cnf isn't detected because self-hosted runners are running under @@ -150,14 +155,14 @@ jobs: run: | 'C:\Program Files\CMake\bin' >> $env:GITHUB_PATH "$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_PATH - "$env:TINY_QT_ROOT\6.7.1\msvc2019_64\bin" >> $env:GITHUB_PATH + "$env:TINY_QT_ROOT\$env:TINY_QT_VERSION\$env:TinyQtSpecPlain\bin" >> $env:GITHUB_PATH # 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 + "VCPKG_MAX_CONCURRENCY=$env:TINY_PARALLEL" >> $env:GITHUB_ENV - name: vcpkg needs upgrade? (once per day) run: | @@ -251,7 +256,7 @@ jobs: - name: TinyORM cmake build ✨ (${{ env.TinyORMBuildFolder }}) working-directory: ${{ env.TinyORMBuildTree }} run: | - cmake.exe --build . --target all --parallel $env:TinyParallel + cmake.exe --build . --target all --parallel $env:TINY_PARALLEL - name: Ccache print statistics run: | @@ -277,10 +282,12 @@ jobs: DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF }} 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 16 + run: >- + ctest.exe --output-on-failure + --parallel ([int] $env:TINY_PARALLEL + $env:NUMBER_OF_PROCESSORS / 2) env: DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }} diff --git a/.github/workflows/msvc2022-qt6.yml b/.github/workflows/msvc2022-qt6.yml index f4525ad12..8fc0e2566 100644 --- a/.github/workflows/msvc2022-qt6.yml +++ b/.github/workflows/msvc2022-qt6.yml @@ -29,7 +29,12 @@ jobs: env: TINY_QT_VERSION: 6.7.1 - TINY_QT_SPEC: msvc2019_64 + TINY_QT_SPEC: win64_msvc2019_64 + # First value is a compressed data size + # ~ 190 * 3 + 100 + TINY_CCACHE_MAX_SIZE: 700M + TINY_MYSQL_SERVICE: MySQL + TINY_POSTGRES_SERVICE: postgresql-x64-14 strategy: matrix: @@ -57,6 +62,11 @@ jobs: $mysqlDataPath = Join-Path -Path $runnerWorkPath -ChildPath 'mysql/data' "TinyMySQLDataPath=$mysqlDataPath" >> $env:GITHUB_ENV + + $qtSpecPlain = $env:TINY_QT_SPEC.Split('_')[1..$env:TINY_QT_SPEC.Count] -join '_' + "TinyQtSpecPlain=$qtSpecPlain" >> $env:GITHUB_ENV + + "TinyParallel=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} @@ -183,8 +193,8 @@ jobs: - name: PostgreSQL service start run: | - Set-Service -Name postgresql-x64-14 -StartupType Manual - Start-Service postgresql-x64-14 + Set-Service -Name $env:TINY_POSTGRES_SERVICE -StartupType Manual + Start-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL change ${{ secrets.DB_PGSQL_ROOT_USERNAME }} password run: >- @@ -240,20 +250,18 @@ jobs: - name: PostgreSQL service restart run: | - Restart-Service postgresql-x64-14 + Restart-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL service check status run: | - $serviceName = 'postgresql-x64-14' - Write-Output '::group::Get-Service' - $pgsqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_POSTGRES_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::pg_isready' @@ -407,8 +415,8 @@ jobs: - name: MySQL service install/start run: | - mysqld.exe --install MySQL - Start-Service MySQL + mysqld.exe --install $env:TINY_MYSQL_SERVICE + Start-Service $env:TINY_MYSQL_SERVICE # Securing the root account even on localhost is for testing to make sure that everything # works as expected @@ -490,16 +498,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::Ping' @@ -575,7 +581,7 @@ jobs: with: archives: qtbase version: ${{ env.TINY_QT_VERSION }} - arch: win64_${{ env.TINY_QT_SPEC }} + arch: ${{ env.TINY_QT_SPEC }} source: true src-archives: qtbase cache: true @@ -615,7 +621,7 @@ jobs: run: >- ./tools/qtbuild-qmysql-driver.ps1 -SkipInitializeBuildEnvironment -QtRootPath (Get-Item -Path $env:QT_PLUGIN_PATH).Parent.Parent.Parent - -QtVersion $env:TINY_QT_VERSION -QtSpec $env:TINY_QT_SPEC + -QtVersion $env:TINY_QT_VERSION -QtSpec $env:TinyQtSpecPlain -MySQLServerPath $env:TinyMySQLInstallationPath -BuildPath $env:RUNNER_WORKSPACE @@ -647,9 +653,7 @@ jobs: - name: Ccache prepare configuration 🥳 run: | - # First value is compressed data size - # ~ 190 * 3 + 100 - ccache.exe --set-config max_size=700M + 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 @@ -669,7 +673,7 @@ jobs: 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 + "VCPKG_MAX_CONCURRENCY=$env:TinyParallel" >> $env:GITHUB_ENV - name: CMake print version run: | @@ -712,7 +716,7 @@ jobs: - name: TinyORM cmake build ✨ (msvc-cmake-${{ matrix.build-type.key }}) run: >- cmake.exe --build ../TinyORM-builds-cmake/build-msvc-cmake-${{ matrix.build-type.key }} - --target all --parallel 2 + --target all --parallel $env:TinyParallel - name: Ccache print statistics run: | @@ -747,10 +751,12 @@ jobs: 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: ../TinyORM-builds-cmake/build-msvc-cmake-${{ matrix.build-type.key }} - run: | - ctest.exe --output-on-failure --parallel 4 + 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_COLLATION }} diff --git a/.github/workflows/msys2-ucrt64-drivers.yml b/.github/workflows/msys2-ucrt64-drivers.yml index ac5693b1d..d19b3320e 100644 --- a/.github/workflows/msys2-ucrt64-drivers.yml +++ b/.github/workflows/msys2-ucrt64-drivers.yml @@ -31,6 +31,14 @@ jobs: # Self-hosted runner is Windows 11 (Release Preview channel - 24H2) runs-on: [ self-hosted, windows ] + env: + # Don't user more than 3 for GCC, it would need 64GB RAM (no money 💵) + TINY_PARALLEL_GCC: 3 + TINY_PARALLEL_CLANG_OR_VCPKG: 9 + TINY_MYSQL_SERVICE: MySQL84 + # Used by the msys2.cmd script + MSYS2_ROOT: C:\msys64 + strategy: matrix: drivers-type: [ Shared, Loadable, Static ] @@ -49,10 +57,6 @@ jobs: - key: gcc command: g++.exe - # Used by the msys2.cmd script - env: - MSYS2_ROOT: C:\msys64 - steps: - uses: actions/checkout@v4 with: @@ -63,10 +67,6 @@ jobs: $runnerWorkPath = Resolve-Path -Path "$env:RUNNER_WORKSPACE/.." "TinyRunnerWorkPath=$runnerWorkPath" >> $env:GITHUB_ENV - # Don't user more than 3 for GCC, it would need 64GB RAM (no money 💵) - $parallel = ${{ matrix.compiler.key == 'gcc' && 3 || 9 }} - "TinyParallel=$parallel" >> $env:GITHUB_ENV - $tinyormPath = Resolve-Path -Path ./main "TinyORMPath=$tinyormPath" >> $env:GITHUB_ENV @@ -80,18 +80,22 @@ jobs: $tinyormBuildFolder "TinyORMBuildTree=$tinyormBuildTree" >> $env:GITHUB_ENV + $parallel = '${{ matrix.compiler.key }}' -ceq 'gcc' ? $env:TINY_PARALLEL_GCC : + $env:TINY_PARALLEL_CLANG_OR_VCPKG + "TinyParallel=$parallel" >> $env:GITHUB_ENV + + "TinyParallelVcpkg=$env:TINY_PARALLEL_CLANG_OR_VCPKG" >> $env:GITHUB_ENV + - name: MySQL service check status run: | - $serviceName = 'MySQL84' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' # .mylogin.cnf isn't detected because self-hosted runners are running under @@ -147,7 +151,7 @@ jobs: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV echo 'VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamic' >> $GITHUB_ENV echo 'VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-dynamic' >> $GITHUB_ENV - echo "VCPKG_MAX_CONCURRENCY=$env:TinyParallel" >> $GITHUB_ENV + echo "VCPKG_MAX_CONCURRENCY=$TinyParallelVcpkg" >> $GITHUB_ENV - name: vcpkg needs upgrade? (once per day) run: | @@ -220,7 +224,7 @@ jobs: cmake.exe --log-level=DEBUG --log-context -S . - -B $env:TinyORMBuildTree + -B $TinyORMBuildTree -G Ninja -D CMAKE_CXX_COMPILER_LAUNCHER:FILEPATH='/ucrt64/bin/ccache.exe' -D CMAKE_CXX_COMPILER:FILEPATH="/ucrt64/bin/${{ matrix.compiler.command }}" @@ -246,7 +250,7 @@ jobs: shell: msys2 {0} working-directory: ${{ env.TinyORMBuildTree }} run: | - cmake.exe --build . --target all --parallel $env:TinyParallel + cmake.exe --build . --target all --parallel $TinyParallel - name: Ccache print statistics shell: msys2 {0} @@ -270,11 +274,12 @@ jobs: DB_MYSQL_USERNAME: ${{ secrets.DB_MYSQL_USERNAME_SELF_MSYS2 }} TOM_TESTDATA_ENV: ${{ vars.TOM_TESTDATA_ENV }} + # $NUMBER_OF_PROCESSORS / 2 : rounds down; also don't use nproc here! - name: TinyORM execute ctest 🔥 shell: msys2 {0} working-directory: ${{ env.TinyORMBuildTree }} run: | - ctest.exe --output-on-failure --parallel 16 + ctest.exe --output-on-failure --parallel $(($TinyParallel + $NUMBER_OF_PROCESSORS / 2)) env: DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }} diff --git a/.github/workflows/msys2-ucrt64.yml b/.github/workflows/msys2-ucrt64.yml index 55d7ac07b..d3e91bd9a 100644 --- a/.github/workflows/msys2-ucrt64.yml +++ b/.github/workflows/msys2-ucrt64.yml @@ -24,6 +24,16 @@ jobs: runs-on: windows-2022 + env: + # First value is a compressed data size + # gcc: ~ 180 * 3 + 100 ; clang: ~ 140 * 3 + 100 + TINY_CCACHE_MAX_SIZE_GCC: 640M + TINY_CCACHE_MAX_SIZE_CLANG: 520M + # Clang and vcpkg uses $env:NUMBER_OF_PROCESSORS + TINY_PARALLEL_GCC: 2 + TINY_MYSQL_SERVICE: MySQL + TINY_POSTGRES_SERVICE: postgresql-x64-14 + strategy: matrix: compiler: @@ -61,13 +71,23 @@ jobs: $mysqlDataPath = Join-Path -Path $runnerWorkPath -ChildPath 'mysql/data' "TinyMySQLDataPath=$mysqlDataPath" >> $env:GITHUB_ENV + + $ccacheMaxSize = '${{ matrix.compiler.key }}' -ceq 'gcc' ? $env:TINY_CCACHE_MAX_SIZE_GCC : + $env:TINY_CCACHE_MAX_SIZE_CLANG + "TinyCcacheMaxSize=$ccacheMaxSize" >> $env:GITHUB_ENV + + $parallel = '${{ matrix.compiler.key }}' -ceq 'gcc' ? $env:TINY_PARALLEL_GCC : + $env:NUMBER_OF_PROCESSORS + "TinyParallel=$parallel" >> $env:GITHUB_ENV + + "TinyParallelVcpkg=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV env: DB_SQLITE_DATABASE: ${{ secrets.DB_SQLITE_DATABASE }} - name: PostgreSQL service start run: | - Set-Service -Name postgresql-x64-14 -StartupType Manual - Start-Service postgresql-x64-14 + Set-Service -Name $env:TINY_POSTGRES_SERVICE -StartupType Manual + Start-Service $env:TINY_POSTGRES_SERVICE - name: PostgreSQL PGBIN add on the $env:Path run: | @@ -75,11 +95,11 @@ jobs: - name: PostgreSQL service check status run: | - $pgsqlService = Get-Service postgresql-x64-14 + $pgsqlService = Get-Service $env:TINY_POSTGRES_SERVICE Write-Output $pgsqlService $pgsqlService.status.ToString() -ceq 'Running' ` - -or $(throw 'postgresql-x64-14 service is not running') > $null + -or $(throw "$env:TINY_POSTGRES_SERVICE service is not running") > $null pg_isready.exe @@ -127,8 +147,8 @@ jobs: - name: MySQL service install/start run: | - mysqld.exe --install MySQL - Start-Service MySQL + 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 😬 @@ -196,7 +216,7 @@ jobs: "source $filepath" | mysql.exe --user=$env:DB_MYSQL_ROOT_USERNAME --password=$env:DB_MYSQL_ROOT_PASSWORD mysql - Restart-Service 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 }} @@ -204,16 +224,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' Write-Output '::group::Ping' @@ -311,9 +329,7 @@ jobs: - name: Ccache prepare configuration 🥳 shell: msys2 {0} run: | - # First value is compressed data size - # gcc: ~ 180 * 3 + 100 ; clang: ~ 140 * 3 + 100 - ccache.exe --set-config max_size=${{ matrix.compiler.key == 'gcc' && '640M' || '520M' }} + ccache.exe --set-config max_size=$TinyCcacheMaxSize ccache.exe --set-config sloppiness=pch_defines,time_macros ccache.exe --set-config depend_mode=true ccache.exe --set-config inode_cache=true @@ -335,7 +351,7 @@ jobs: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV echo 'VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamic' >> $GITHUB_ENV echo 'VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-dynamic' >> $GITHUB_ENV - echo 'VCPKG_MAX_CONCURRENCY=2' >> $GITHUB_ENV + echo "VCPKG_MAX_CONCURRENCY=$TinyParallelVcpkg" >> $GITHUB_ENV - name: CMake print version shell: msys2 {0} @@ -389,7 +405,7 @@ jobs: run: >- cmake.exe --build ../TinyORM-builds-cmake/build-${{ matrix.compiler.key }}-${{ matrix.qt.key }}-cmake-debug - --target all --parallel ${{ matrix.compiler.key == 'gcc' && 1 || 2 }} + --target all --parallel $TinyParallel - name: Ccache print statistics shell: msys2 {0} @@ -422,12 +438,13 @@ jobs: DB_SQLITE_DATABASE: ${{ env.TinySQLitePath }} TOM_TESTDATA_ENV: ${{ vars.TOM_TESTDATA_ENV }} + # $NUMBER_OF_PROCESSORS / 2 : rounds down; also don't use nproc here! - name: TinyORM execute ctest 🔥 shell: msys2 {0} working-directory: >- ../TinyORM-builds-cmake/build-${{ matrix.compiler.key }}-${{ matrix.qt.key }}-cmake-debug run: | - ctest.exe --output-on-failure --parallel 4 + ctest.exe --output-on-failure --parallel $(($TinyParallel + $NUMBER_OF_PROCESSORS / 2)) env: DB_MYSQL_CHARSET: ${{ secrets.DB_MYSQL_CHARSET }} DB_MYSQL_COLLATION: ${{ secrets.DB_MYSQL_COLLATION }} diff --git a/.github/workflows/vcpkg-windows-drivers.yml b/.github/workflows/vcpkg-windows-drivers.yml index 761299460..fa9018faf 100644 --- a/.github/workflows/vcpkg-windows-drivers.yml +++ b/.github/workflows/vcpkg-windows-drivers.yml @@ -20,6 +20,10 @@ jobs: # Self-hosted runner is Windows 11 (Release Preview channel - 24H2) runs-on: [ self-hosted, windows ] + env: + TINY_MYSQL_SERVICE: MySQL84 + TINY_PARALLEL: 10 + strategy: matrix: build-type: @@ -56,8 +60,6 @@ jobs: $mysqlInstallationPath = Split-Path -Parent -Path (Split-Path -Parent -Path $mysqlExePath) "TinyMySQLInstallationPath=$mysqlInstallationPath" >> $env:GITHUB_ENV - "TinyParallel=10" >> $env:GITHUB_ENV - $tinyormPath = Resolve-Path -Path ./main "TinyORMPath=$tinyormPath" >> $env:GITHUB_ENV @@ -70,16 +72,14 @@ jobs: - name: MySQL service check status run: | - $serviceName = 'MySQL84' - Write-Output '::group::Get-Service' - $mysqlService = Get-Service $serviceName + $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 "$serviceName service is not running") > $null + $(throw "$env:TINY_MYSQL_SERVICE service is not running") > $null Write-Output '::endgroup::' # .mylogin.cnf isn't detected because self-hosted runners are running under @@ -115,7 +115,7 @@ jobs: 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 + "VCPKG_MAX_CONCURRENCY=$env:TINY_PARALLEL" >> $env:GITHUB_ENV $vcpkgPath = Resolve-Path -Path "$env:TinyORMPath/cmake/vcpkg" @@ -312,7 +312,7 @@ jobs: working-directory: >- ../HelloWorld-builds-cmake/Drivers-vcpkgmanifest-msvc-${{ matrix.build-type.key }} run: | - cmake.exe --build . --target all --parallel $env:TinyParallel + cmake.exe --build . --target all --parallel $env:TINY_PARALLEL - name: HelloWorld-TinyDrivers execute (MySQL) 🏁 working-directory: >- @@ -387,7 +387,7 @@ jobs: - name: TinyORM cmake build ✨ (manual-msvc-${{ matrix.build-type.key }}) working-directory: ../TinyORM-builds-cmake/Drivers-manual-msvc-${{ matrix.build-type.key }} run: | - cmake.exe --build . --target all --parallel $env:TinyParallel + cmake.exe --build . --target all --parallel $env:TINY_PARALLEL - name: Ccache print statistics run: | @@ -420,7 +420,7 @@ jobs: working-directory: >- ../HelloWorld-builds-cmake/Drivers-manual-msvc-${{ matrix.build-type.key }} run: | - cmake.exe --build . --target all --parallel $env:TinyParallel + cmake.exe --build . --target all --parallel $env:TINY_PARALLEL - name: HelloWorld-TinyDrivers execute (MySQL) 🏁 working-directory: >- @@ -499,7 +499,7 @@ jobs: working-directory: >- ../HelloWorld-builds-cmake/Drivers-fetchcontent-msvc-${{ matrix.build-type.key }} run: | - cmake.exe --build . --target install --parallel $env:TinyParallel + cmake.exe --build . --target install --parallel $env:TINY_PARALLEL - name: Ccache print statistics run: | diff --git a/.github/workflows/vcpkg-windows.yml b/.github/workflows/vcpkg-windows.yml index 1bda07740..537da2db4 100644 --- a/.github/workflows/vcpkg-windows.yml +++ b/.github/workflows/vcpkg-windows.yml @@ -24,6 +24,13 @@ jobs: # Self-hosted runner is Windows 11 (Release Preview channel - 24H2) runs-on: [ self-hosted, windows ] + env: + TINY_QT_SPEC: win64_msvc2019_64 + # First value is a compressed data size + # ~ 70 * 3 + 100 + TINY_CCACHE_MAX_SIZE: 500M + TINY_PARALLEL: 10 + strategy: matrix: build-type: @@ -69,7 +76,7 @@ jobs: $isSelfHostedRunner = $env:RUNNER_NAME.StartsWith('merydeye-', $true, $null) "TinyIsSelfHostedRunner=$isSelfHostedRunner" >> $env:GITHUB_ENV - $parallel = $isSelfHostedRunner ? 10 : 2 + $parallel = $isSelfHostedRunner ? $env:TINY_PARALLEL : $env:NUMBER_OF_PROCESSORS "TinyParallel=$parallel" >> $env:GITHUB_ENV $tinyormPath = Resolve-Path -Path ./main @@ -320,7 +327,7 @@ jobs: with: archives: qtbase version: ${{ matrix.qt.version }} - arch: win64_msvc2019_64 + arch: ${{ env.TINY_QT_SPEC }} cache: true setup-python: false extra: --external 7z.exe @@ -377,9 +384,7 @@ jobs: - name: Ccache prepare configuration 🥳 if: env.TinyIsSelfHostedRunner == 'false' run: | - # First value is compressed data size - # ~ 70 * 3 + 100 - ccache.exe --set-config max_size=500M + 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