From bd5cf513042177347b1ae5cac88e1b251545de8d Mon Sep 17 00:00:00 2001 From: Alonso Schaich Date: Thu, 19 Oct 2023 14:57:54 +0000 Subject: [PATCH 01/25] Create cmake workflows Closes #19 --- CMakeLists.txt | 6 ++++++ CMakePresets.json | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 CMakePresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index e3c7a37..862a92d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,5 +26,11 @@ target_link_libraries(TinyOrmQueryTest PRIVATE Qt::Core Qt::Sql Qt::Test TinyOrm set_target_properties(TinyOrmQueryTest PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY}) enable_testing() + add_test(NAME QSqlQueryTest COMMAND QSqlQueryTest -o "${CMAKE_CURRENT_BINARY_DIR}/QSqlQueryTest.xml,junitxml" COMMAND_EXPAND_LISTS) +set_property(TEST QSqlQueryTest PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin") +set_property(TEST QSqlQueryTest APPEND PROPERTY ENVIRONMENT_MODIFICATION "QT_PLUGIN_PATH=set:${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/Qt6/plugins") + add_test(NAME TinyOrmQueryTest COMMAND TinyOrmQueryTest -o "${CMAKE_CURRENT_BINARY_DIR}/TinyOrmQueryTest.xml,junitxml" COMMAND_EXPAND_LISTS) +set_property(TEST TinyOrmQueryTest PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin") +set_property(TEST TinyOrmQueryTest APPEND PROPERTY ENVIRONMENT_MODIFICATION "QT_PLUGIN_PATH=set:${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/Qt6/plugins") diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..97074a1 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,48 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "cacheVariables": { + "VCPKG_INSTALL_OPTIONS": "--debug", + "VCPKG_VERBOSE": "ON", + "VCPKG_APPLOCAL_DEPS": "OFF" + }, + "toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", + "hidden": true + }, + { + "name": "debug", + "binaryDir": "${sourceDir}/Debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "inherits": [ "base" ] + }, + { + "name": "release", + "binaryDir": "${sourceDir}/Release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + }, + "inherits": [ "base" ] + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug", + "configuration": "Debug" + }, + { + "name": "release", + "configurePreset": "release", + "configuration": "Release" + } + ] +} From ffd7d73a6b2b07f8a1a72103a547aae5ba1adbd7 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 06:57:26 +0900 Subject: [PATCH 02/25] Add CI workflow presets --- CMakePresets.json | 156 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 97074a1..8801c79 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -18,7 +18,6 @@ }, { "name": "debug", - "binaryDir": "${sourceDir}/Debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }, @@ -26,11 +25,82 @@ }, { "name": "release", - "binaryDir": "${sourceDir}/Release", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }, "inherits": [ "base" ] + }, + + { + "name": "ci", + "binaryDir": "${sourceDir}/build", + "hidden": true + }, + { + "name": "ninja", + "generator": "Ninja", + "hidden": true + }, + { + "name": "x64-windows", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows" + }, + "hidden": true + }, + { + "name": "x64-windows-static", + "cacheVariables": { + "MSVC_RUNTIME_DYNAMIC": "OFF", + "VCPKG_TARGET_TRIPLET": "x64-windows-static" + }, + "hidden": true + }, + { + "name": "x64-linux", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-linux" + }, + "hidden": true + }, + { + "name": "x64-freebsd", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-freebsd" + }, + "hidden": true + }, + { + "name": "ci-ninja-x64-windows-release", + "inherits": ["ci", "ninja", "x64-windows", "release"] + }, + { + "name": "ci-ninja-x64-windows-debug", + "inherits": ["ci", "ninja", "x64-windows", "debug"] + }, + { + "name": "ci-ninja-x64-windows-static-release", + "inherits": ["ci", "ninja", "x64-windows-static", "release"] + }, + { + "name": "ci-ninja-x64-windows-static-debug", + "inherits": ["ci", "ninja", "x64-windows-static", "debug"] + }, + { + "name": "ci-ninja-x64-linux-release", + "inherits": ["ci", "ninja", "x64-linux", "release"] + }, + { + "name": "ci-ninja-x64-linux-debug", + "inherits": ["ci", "ninja", "x64-linux", "debug"] + }, + { + "name": "ci-ninja-x64-freebsd-release", + "inherits": ["ci", "ninja", "x64-freebsd", "release"] + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "inherits": ["ci", "ninja", "x64-freebsd", "debug"] } ], "buildPresets": [ @@ -43,6 +113,88 @@ "name": "release", "configurePreset": "release", "configuration": "Release" + }, + { + "name": "ci-ninja-x64-windows-debug", + "configurePreset": "ci-ninja-x64-windows-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninja-x64-windows-release", + "configurePreset": "ci-ninja-x64-windows-release", + "configuration": "Release" + }, + { + "name": "ci-ninja-x64-windows-static-debug", + "configurePreset": "ci-ninja-x64-windows-static-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninja-x64-windows-static-release", + "configurePreset": "ci-ninja-x64-windows-static-release", + "configuration": "Release" + }, + { + "name": "ci-ninja-x64-linux-debug", + "configurePreset": "ci-ninja-x64-linux-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninja-x64-linux-release", + "configurePreset": "ci-ninja-x64-linux-release", + "configuration": "Release" + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "configurePreset": "ci-ninja-x64-freebsd-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninja-x64-freebsd-release", + "configurePreset": "ci-ninja-x64-freebsd-release", + "configuration": "Release" + } + ], + "testPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "release", + "configurePreset": "release" + }, + { + "name": "ci-ninja-x64-windows-debug", + "configurePreset": "ci-ninja-x64-windows-debug" + }, + { + "name": "ci-ninja-x64-windows-release", + "configurePreset": "ci-ninja-x64-windows-release" + }, + { + "name": "ci-ninja-x64-windows-static-debug", + "configurePreset": "ci-ninja-x64-windows-static-debug" + }, + { + "name": "ci-ninja-x64-windows-static-release", + "configurePreset": "ci-ninja-x64-windows-static-release" + }, + { + "name": "ci-ninja-x64-linux-debug", + "configurePreset": "ci-ninja-x64-linux-debug" + }, + { + "name": "ci-ninja-x64-linux-release", + "configurePreset": "ci-ninja-x64-linux-release" + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "configurePreset": "ci-ninja-x64-freebsd-debug" + }, + { + "name": "ci-ninja-x64-freebsd-release", + "configurePreset": "ci-ninja-x64-freebsd-release" } ] } From b568d54301ff3d6e11a7528288baaf7158f24438 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 06:58:00 +0900 Subject: [PATCH 03/25] Use CMakePreset workflows --- .github/workflows/build-and-test.yml | 38 +++++++++++++--------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f2ee0a0..79caab2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,26 +15,19 @@ jobs: strategy: fail-fast: false matrix: - os: ['windows-2022', 'ubuntu-22.04'] - vcpkg_library_linkage: ['dynamic', 'static'] - build_type: ['Debug', 'Release'] + generator: ['ninja'] + vcpkg_target_triplet: ['x64-windows', 'x64-windows-static', 'x64-linux'] + build_type: ['debug', 'release'] include: - - os: 'ubuntu-22.04' + - vcpkg_target_triplet: 'x64-linux' mono: 'mono' - - os: 'windows-2022' + os: 'ubuntu-22.04' + - vcpkg_target_triplet: 'x64-windows' mono: '' - - os: 'ubuntu-22.04' - vcpkg_library_linkage: 'static' - vcpkg_target_triplet: 'x64-linux' - - os: 'windows-2022' - vcpkg_library_linkage: 'dynamic' - vcpkg_target_triplet: 'x64-windows' - - os: 'windows-2022' - vcpkg_library_linkage: 'static' - vcpkg_target_triplet: 'x64-windows-static' - exclude: - - os: 'ubuntu-22.04' - vcpkg_library_linkage: 'dynamic' + os: 'windows-2022' + - vcpkg_target_triplet: 'x64-windows-static' + mono: '' + os: 'windows-2022' permissions: contents: read @@ -44,7 +37,6 @@ jobs: env: VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }} - BUILD_TYPE: ${{ matrix.build_type }} steps: - name: Update ubuntu repository @@ -90,13 +82,17 @@ jobs: -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources + - name: Configure + shell: pwsh + run: cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + - name: Build shell: pwsh - run: ./build.ps1 + run: cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - - name: Run Tests + - name: Test shell: pwsh - run: pwsh ./test.ps1 + run: ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: Archive VCPKG Log Files if: always() From e37bcc692277da69064e84a8c609821c22bfcc2e Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 07:15:25 +0900 Subject: [PATCH 04/25] Try to get a ninja --- .github/workflows/build-and-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 79caab2..883e8d2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -58,7 +58,9 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} shell: bash run: sudo apt-get install libgl1-mesa-dev mesa-common-dev - + + - name: Install Ninja + uses: seanmiddleditch/gha-setup-ninja@v4 - name: Checkout Repository uses: actions/checkout@v3 @@ -81,7 +83,7 @@ jobs: ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) setapikey "${{ secrets.GITHUB_TOKEN }}" \ -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources - + - name: Configure shell: pwsh run: cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} From 8e156e714d50ab37408b64906d855b10dc119c5c Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 07:31:51 +0900 Subject: [PATCH 05/25] Try harder --- .github/workflows/build-and-test.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 883e8d2..6060538 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -58,9 +58,16 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} shell: bash run: sudo apt-get install libgl1-mesa-dev mesa-common-dev + + - name: Install ubuntu Ninja + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo sudo apt-get install ninja-build - - name: Install Ninja - uses: seanmiddleditch/gha-setup-ninja@v4 + - name: Install windows Ninja + if: ${{ matrix.os == 'windows-2022' }} + shell: pwsh + run: choco install ninja - name: Checkout Repository uses: actions/checkout@v3 From 508b1ff56cf93d7a3f6646c018f1219b2defe7a6 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 07:47:17 +0900 Subject: [PATCH 06/25] Restore JUnit format --- CMakePresets.json | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 8801c79..42b311a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -164,37 +164,53 @@ "name": "release", "configurePreset": "release" }, + { + "name": "ci", + "output": { + "outputJUnitFile": "${sourceDir}/build/ctest.xml", + "verbosity": "extra" + }, + "hidden": true + }, { "name": "ci-ninja-x64-windows-debug", - "configurePreset": "ci-ninja-x64-windows-debug" + "configurePreset": "ci-ninja-x64-windows-debug", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-windows-release", - "configurePreset": "ci-ninja-x64-windows-release" + "configurePreset": "ci-ninja-x64-windows-release", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-windows-static-debug", - "configurePreset": "ci-ninja-x64-windows-static-debug" + "configurePreset": "ci-ninja-x64-windows-static-debug", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-windows-static-release", - "configurePreset": "ci-ninja-x64-windows-static-release" + "configurePreset": "ci-ninja-x64-windows-static-release", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-linux-debug", - "configurePreset": "ci-ninja-x64-linux-debug" + "configurePreset": "ci-ninja-x64-linux-debug", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-linux-release", - "configurePreset": "ci-ninja-x64-linux-release" + "configurePreset": "ci-ninja-x64-linux-release", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-freebsd-debug", - "configurePreset": "ci-ninja-x64-freebsd-debug" + "configurePreset": "ci-ninja-x64-freebsd-debug", + "inherits": ["ci"] }, { "name": "ci-ninja-x64-freebsd-release", - "configurePreset": "ci-ninja-x64-freebsd-release" + "configurePreset": "ci-ninja-x64-freebsd-release", + "inherits": ["ci"] } ] } From c20f233dbec253f836d108c91e7c8de97deeeebd Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 08:05:30 +0900 Subject: [PATCH 07/25] Try forcing cl.exe usage on windows --- CMakePresets.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 42b311a..ee882e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,6 +44,8 @@ { "name": "x64-windows", "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe", "VCPKG_TARGET_TRIPLET": "x64-windows" }, "hidden": true From fdf852e78e67f23050258ef614bfd2da8b2d2f2d Mon Sep 17 00:00:00 2001 From: Alonso Schaich Date: Thu, 19 Oct 2023 23:32:34 +0000 Subject: [PATCH 08/25] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6060538..a89ef8d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -63,12 +63,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} shell: bash run: sudo sudo apt-get install ninja-build - - - name: Install windows Ninja - if: ${{ matrix.os == 'windows-2022' }} - shell: pwsh - run: choco install ninja - + - name: Checkout Repository uses: actions/checkout@v3 with: @@ -91,7 +86,20 @@ jobs: -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources - - name: Configure + - name: Configure (VsDevShell) + if: ${{ matrix.os == 'windows-2022' }} + shell: pwsh + run: | + $vsInstallationPath=(& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" -property "installationPath") + Import-Module "${vsInstallationPath}/Common7/Tools/Microsoft.VisualStudio.DevShell.dll" + # invoking vcvarsall leaves the shell in another directory... + pushd . + Enter-VsDevShell -VsInstallPath ${vsInstallationPath} + popd + cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + + - name: Configure (non VsDevShell) + if: ${{ matrix.os != 'windows-2022' }} shell: pwsh run: cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} From 78335454b0fb1e377ee4e8b3cb39318c33a46dc0 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 08:35:59 +0900 Subject: [PATCH 09/25] Revert "Try forcing cl.exe usage on windows" This reverts commit c20f233dbec253f836d108c91e7c8de97deeeebd. --- CMakePresets.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index ee882e4..42b311a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,8 +44,6 @@ { "name": "x64-windows", "cacheVariables": { - "CMAKE_C_COMPILER": "cl.exe", - "CMAKE_CXX_COMPILER": "cl.exe", "VCPKG_TARGET_TRIPLET": "x64-windows" }, "hidden": true From f04c0c7a5d682a8e1cf32d5a2aae410f20a14cf7 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 08:43:55 +0900 Subject: [PATCH 10/25] The error message smells like build-type selection bugs in qt --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 42b311a..497eb4c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -38,7 +38,7 @@ }, { "name": "ninja", - "generator": "Ninja", + "generator": "Ninja Multi-Config", "hidden": true }, { From 0366423fca83e762310d6db01b420b8cd7e4a36c Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 09:22:44 +0900 Subject: [PATCH 11/25] Enter-VsDevShell defaults to x86 [...] --- .github/workflows/build-and-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a89ef8d..d3c84ec 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -25,9 +25,11 @@ jobs: - vcpkg_target_triplet: 'x64-windows' mono: '' os: 'windows-2022' + VsDevShellArch: 'amd64' - vcpkg_target_triplet: 'x64-windows-static' mono: '' os: 'windows-2022' + VsDevShellArch: 'amd64' permissions: contents: read @@ -94,7 +96,7 @@ jobs: Import-Module "${vsInstallationPath}/Common7/Tools/Microsoft.VisualStudio.DevShell.dll" # invoking vcvarsall leaves the shell in another directory... pushd . - Enter-VsDevShell -VsInstallPath ${vsInstallationPath} + Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }} popd cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} From 36a485ece292e88a3a2ba8a64ed6570ca5eb0168 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 09:48:39 +0900 Subject: [PATCH 12/25] Setup configuration for testPresets --- CMakePresets.json | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 497eb4c..d77e9c6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -158,11 +158,13 @@ "testPresets": [ { "name": "debug", - "configurePreset": "debug" + "configurePreset": "debug", + "configuration": "Debug" }, { "name": "release", - "configurePreset": "release" + "configurePreset": "release", + "configuration": "Release" }, { "name": "ci", @@ -175,42 +177,42 @@ { "name": "ci-ninja-x64-windows-debug", "configurePreset": "ci-ninja-x64-windows-debug", - "inherits": ["ci"] + "inherits": ["ci", "debug"] }, { "name": "ci-ninja-x64-windows-release", "configurePreset": "ci-ninja-x64-windows-release", - "inherits": ["ci"] + "inherits": ["ci", "release"] }, { "name": "ci-ninja-x64-windows-static-debug", "configurePreset": "ci-ninja-x64-windows-static-debug", - "inherits": ["ci"] + "inherits": ["ci", "debug"] }, { "name": "ci-ninja-x64-windows-static-release", "configurePreset": "ci-ninja-x64-windows-static-release", - "inherits": ["ci"] + "inherits": ["ci", "release"] }, { "name": "ci-ninja-x64-linux-debug", "configurePreset": "ci-ninja-x64-linux-debug", - "inherits": ["ci"] + "inherits": ["ci", "debug"] }, { "name": "ci-ninja-x64-linux-release", "configurePreset": "ci-ninja-x64-linux-release", - "inherits": ["ci"] + "inherits": ["ci", "release"] }, { "name": "ci-ninja-x64-freebsd-debug", "configurePreset": "ci-ninja-x64-freebsd-debug", - "inherits": ["ci"] + "inherits": ["ci", "debug"] }, { "name": "ci-ninja-x64-freebsd-release", "configurePreset": "ci-ninja-x64-freebsd-release", - "inherits": ["ci"] + "inherits": ["ci", "release"] } ] } From 6df4170698a862e504153e37595d52d631b1cbf2 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 09:50:07 +0900 Subject: [PATCH 13/25] Print DevShells --- .github/workflows/build-and-test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d3c84ec..5fb4217 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -88,6 +88,12 @@ jobs: -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources + - name: Print VsDevShells + if: ${{ matrix.os == 'windows-2022' }} + shell: pwsh + run: | + & "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" + - name: Configure (VsDevShell) if: ${{ matrix.os == 'windows-2022' }} shell: pwsh From 228f17c23f3b69f080899a2e2b0a95960f1c2d34 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 09:59:26 +0900 Subject: [PATCH 14/25] Introduce c++20 dependency --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 862a92d..03b702c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ else() set(MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + find_package(Qt6 REQUIRED COMPONENTS Concurrent Core Sql Test) qt_standard_project_setup() From 7ac1b9aafe77b42fbe7adc039898b7a9700bc55b Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:04:35 +0900 Subject: [PATCH 15/25] Try merging the configure and build workflows --- .github/workflows/build-and-test.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5fb4217..d6cdabd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -94,7 +94,7 @@ jobs: run: | & "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" - - name: Configure (VsDevShell) + - name: Build (VsDevShell) if: ${{ matrix.os == 'windows-2022' }} shell: pwsh run: | @@ -105,19 +105,14 @@ jobs: Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }} popd cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - - name: Configure (non VsDevShell) + - name: Build (non VsDevShell) if: ${{ matrix.os != 'windows-2022' }} shell: pwsh - run: cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - - - name: Build - shell: pwsh - run: cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - - - name: Test - shell: pwsh - run: ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + run: | + cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: Archive VCPKG Log Files if: always() From 37941e0cc41d24c0b26d7d5b5d8906466bd7df97 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:13:08 +0900 Subject: [PATCH 16/25] Merge the test job, too --- .github/workflows/build-and-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d6cdabd..76bf912 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -94,7 +94,7 @@ jobs: run: | & "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" - - name: Build (VsDevShell) + - name: CMake Workflow (VsDevShell) if: ${{ matrix.os == 'windows-2022' }} shell: pwsh run: | @@ -106,13 +106,15 @@ jobs: popd cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - - name: Build (non VsDevShell) + - name: CMake Workflow (non VsDevShell) if: ${{ matrix.os != 'windows-2022' }} shell: pwsh run: | cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: Archive VCPKG Log Files if: always() From 6dc86a7ad4792d595f6e5328a7b71748fa806a04 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:20:51 +0900 Subject: [PATCH 17/25] Add ninjamulti generator and fix ninja to be ninjasingle --- .github/workflows/build-and-test.yml | 2 +- CMakePresets.json | 117 +++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 76bf912..4853ff2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - generator: ['ninja'] + generator: ['ninja', 'ninjamulti'] vcpkg_target_triplet: ['x64-windows', 'x64-windows-static', 'x64-linux'] build_type: ['debug', 'release'] include: diff --git a/CMakePresets.json b/CMakePresets.json index d77e9c6..d3e021e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -38,6 +38,11 @@ }, { "name": "ninja", + "generator": "Ninja", + "hidden": true + }, + { + "name": "ninjamulti", "generator": "Ninja Multi-Config", "hidden": true }, @@ -101,6 +106,38 @@ { "name": "ci-ninja-x64-freebsd-debug", "inherits": ["ci", "ninja", "x64-freebsd", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-release", + "inherits": ["ci", "ninjamulti", "x64-windows", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-debug", + "inherits": ["ci", "ninjamulti", "x64-windows", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "inherits": ["ci", "ninjamulti", "x64-windows-static", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "inherits": ["ci", "ninjamulti", "x64-windows-static", "debug"] + }, + { + "name": "ci-ninjamulti-x64-linux-release", + "inherits": ["ci", "ninjamulti", "x64-linux", "release"] + }, + { + "name": "ci-ninjamulti-x64-linux-debug", + "inherits": ["ci", "ninjamulti", "x64-linux", "debug"] + }, + { + "name": "ci-ninjamulti-x64-freebsd-release", + "inherits": ["ci", "ninjamulti", "x64-freebsd", "release"] + }, + { + "name": "ci-ninjamulti-x64-freebsd-debug", + "inherits": ["ci", "ninjamulti", "x64-freebsd", "debug"] } ], "buildPresets": [ @@ -153,6 +190,46 @@ "name": "ci-ninja-x64-freebsd-release", "configurePreset": "ci-ninja-x64-freebsd-release", "configuration": "Release" + }, + { + "name": "ci-ninjamulti-x64-windows-debug", + "configurePreset": "ci-ninjamulti-x64-windows-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninjamulti-x64-windows-release", + "configurePreset": "ci-ninjamulti-x64-windows-release", + "configuration": "Release" + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "configurePreset": "ci-ninjamulti-x64-windows-static-release", + "configuration": "Release" + }, + { + "name": "ci-ninjamulti-x64-linux-debug", + "configurePreset": "ci-ninjamulti-x64-linux-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninjamulti-x64-linux-release", + "configurePreset": "ci-ninjamulti-x64-linux-release", + "configuration": "Release" + }, + { + "name": "ci-ninjamulti-x64-freebsd-debug", + "configurePreset": "ci-ninjamulti-x64-freebsd-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninjamulti-x64-freebsd-release", + "configurePreset": "ci-ninjamulti-x64-freebsd-release", + "configuration": "Release" } ], "testPresets": [ @@ -213,6 +290,46 @@ "name": "ci-ninja-x64-freebsd-release", "configurePreset": "ci-ninja-x64-freebsd-release", "inherits": ["ci", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-debug", + "configurePreset": "ci-ninjamulti-x64-windows-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-release", + "configurePreset": "ci-ninjamulti-x64-windows-release", + "inherits": ["ci", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "configurePreset": "ci-ninjamulti-x64-windows-static-release", + "inherits": ["ci", "release"] + }, + { + "name": "ci-ninjamulti-x64-linux-debug", + "configurePreset": "ci-ninjamulti-x64-linux-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninjamulti-x64-linux-release", + "configurePreset": "ci-ninjamulti-x64-linux-release", + "inherits": ["ci", "release"] + }, + { + "name": "ci-ninjamulti-x64-freebsd-debug", + "configurePreset": "ci-ninjamulti-x64-freebsd-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninjamulti-x64-freebsd-release", + "configurePreset": "ci-ninjamulti-x64-freebsd-release", + "inherits": ["ci", "release"] } ] } From 9d248d35c800610749e21180d72a49045cdbf9bb Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:44:46 +0900 Subject: [PATCH 18/25] Update readme with new instructions --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f6556b..2c33296 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,18 @@ The scope of this project is to provision TinyORM and all dependencies using VCP Run - pwsh build.ps1 + cmake --list-presets -to build, and then +to list the current CI presets. If any of the CI presets is representative enough, they can be used to build and run the tests using e.g. - pwsh test.ps1 + cmake --preset ci-ninja-x64-freebsd-release + cmake --build --preset ci-ninja-x64-freebsd-release + ctest --preset ci-ninja-x64-freebsd-release + +to build using the `ci-ninja-x64-freebsd-release` preset. + +If none of the presets is eligable, the `debug` and `release` presets can be used, though they don't configure a build path nor generator, and the ctest runner can't be used as straightforwardedly: -to run the bundled test case. + cmake --preset release -B mybuildpath + cmake --build mybuildpath --preset release + pushd mybuildpath && ctest -C Release; popd From 511cade378c0d0a1ab7d742270d099e133b6af9d Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:45:51 +0900 Subject: [PATCH 19/25] Use free runners. The big ones are only needed to seed nuget. --- .github/workflows/build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4853ff2..131cab3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,7 +35,7 @@ jobs: contents: read packages: write - runs-on: ${{ matrix.os }}-8-cores + runs-on: ${{ matrix.os }} env: VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }} @@ -105,7 +105,7 @@ jobs: Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }} popd cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} -j 1 ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: CMake Workflow (non VsDevShell) @@ -113,7 +113,7 @@ jobs: shell: pwsh run: | cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} -j 1 ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: Archive VCPKG Log Files From 7bea6e2f7067d95f37e9bbd8e10266ca288371f5 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:47:08 +0900 Subject: [PATCH 20/25] Get rid of the unused shell scripts --- build.ps1 | 33 --------------------------------- build.sh | 17 ----------------- test.ps1 | 30 ------------------------------ 3 files changed, 80 deletions(-) delete mode 100644 build.ps1 delete mode 100644 build.sh delete mode 100644 test.ps1 diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index ed49879..0000000 --- a/build.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -if (${env:GITHUB_WORKSPACE} -eq ${null}) { - ${env:GITHUB_WORKSPACE}=${pwd} -} - -if (${env:BUILD_TYPE} -eq ${null}) { - ${env:BUILD_TYPE}="Debug" -} - -if (${env:VCPKG_TARGET_TRIPLET} -eq ${null}) { - ${env:VCPKG_TARGET_TRIPLET}="x64-windows" -} - -if ("x64-windows-static" -eq "${env:VCPKG_TARGET_TRIPLET}") { - $msvc_runtime_dynamic="Off" -} else { - $msvc_runtime_dynamic="On" -} - -if ("x64-windows", "x64-windows-static" -contains "${env:VCPKG_TARGET_TRIPLET}") { - $cmake_build_args="-v:n" -} - -cmake ` - -B ${env:GITHUB_WORKSPACE}/build ` - -DCMAKE_BUILD_TYPE="${env:BUILD_TYPE}" ` - -DVCPKG_VERBOSE=ON ` - -DVCPKG_INSTALL_OPTIONS="--debug" ` - -DVCPKG_TARGET_TRIPLET="${env:VCPKG_TARGET_TRIPLET}" ` - -DCMAKE_TOOLCHAIN_FILE="${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake" ` - -DMSVC_RUNTIME_DYNAMIC="${msvc_runtime_dynamic}" ` - ${env:GITHUB_WORKSPACE} - -cmake --build ${env:GITHUB_WORKSPACE}/build --config ${env:BUILD_TYPE} --verbose -- ${cmake_build_args} diff --git a/build.sh b/build.sh deleted file mode 100644 index de63795..0000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -if (test -z ${GITHUB_WORKSPACE+x}) then - GITHUB_WORKSPACE=$(pwd) -fi - -if (test -z ${BUILD_TYPE+x}) then - BUILD_TYPE="Debug" -fi - -cmake \ - -B "${GITHUB_WORKSPACE}/build" \ - -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ - -DVCPKG_VERBOSE=ON \ - -DVCPKG_INSTALL_OPTIONS="--debug" \ - -DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake" \ - "${GITHUB_WORKSPACE}" - -cmake --build "${GITHUB_WORKSPACE}/build" --config "${BUILD_TYPE}" diff --git a/test.ps1 b/test.ps1 deleted file mode 100644 index 620d309..0000000 --- a/test.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -if (${env:GITHUB_WORKSPACE} -eq ${null}) { - ${env:GITHUB_WORKSPACE}=${pwd} -} - -if (${env:BUILD_TYPE} -eq ${null}) { - ${env:BUILD_TYPE}="Debug" -} - -if (${env:VCPKG_TARGET_TRIPLET} -eq ${null}) { - ${env:VCPKG_TARGET_TRIPLET}="x64-windows" -} - -if ("x64-windows-static" -eq "${env:VCPKG_TARGET_TRIPLET}") { - ${msvc_runtime_dynamic}="Off" -} else { - ${msvc_runtime_dynamic}="On" -} - -$vcpkgPrefix="${env:GITHUB_WORKSPACE}/build/vcpkg_installed/${env:VCPKG_TARGET_TRIPLET}/" -if ($env:BUILD_TYPE -eq "Debug") { - ${vcpkgPrefix}="${vcpkgPrefix}/debug" -} - -if (${msvc_runtime_dynamic} -eq "On") { - ${env:PATH}="${vcpkgPrefix}/bin;${env:PATH}" - ${env:QT_PLUGIN_PATH}="${vcpkgPrefix}/Qt6/plugins" -} - -cd "${env:GITHUB_WORKSPACE}/build" -ctest --test-dir "${env:GITHUB_WORKSPACE}/build" -C "${env:BUILD_TYPE}" --output-junit "${env:GITHUB_WORKSPACE}/build/ctest.xml" From 5c94adebf3dc89f250e10a4eadc64a3beac474f5 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 10:51:21 +0900 Subject: [PATCH 21/25] Revert "Use free runners. The big ones are only needed to seed nuget." This reverts commit 511cade378c0d0a1ab7d742270d099e133b6af9d. --- .github/workflows/build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 131cab3..4853ff2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,7 +35,7 @@ jobs: contents: read packages: write - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-8-cores env: VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }} @@ -105,7 +105,7 @@ jobs: Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }} popd cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} -j 1 + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: CMake Workflow (non VsDevShell) @@ -113,7 +113,7 @@ jobs: shell: pwsh run: | cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} -j 1 + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} - name: Archive VCPKG Log Files From 834549a335b11a17cf0ce9d49e0493e71b761cf1 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 16:32:38 +0900 Subject: [PATCH 22/25] [skip ci] Add Unix Makefile presets and reorder the file --- CMakePresets.json | 224 +++++++++++++++++++++++++++++----------------- 1 file changed, 143 insertions(+), 81 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index d3e021e..8cbbae3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,6 +36,11 @@ "binaryDir": "${sourceDir}/build", "hidden": true }, + { + "name": "make", + "generator": "Unix Makefiles", + "hidden": true + }, { "name": "ninja", "generator": "Ninja", @@ -47,49 +52,58 @@ "hidden": true }, { - "name": "x64-windows", + "name": "x64-freebsd", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows" + "VCPKG_TARGET_TRIPLET": "x64-freebsd" }, "hidden": true }, { - "name": "x64-windows-static", + "name": "x64-linux", "cacheVariables": { - "MSVC_RUNTIME_DYNAMIC": "OFF", - "VCPKG_TARGET_TRIPLET": "x64-windows-static" + "VCPKG_TARGET_TRIPLET": "x64-linux" }, "hidden": true }, { - "name": "x64-linux", + "name": "x64-windows", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-linux" + "VCPKG_TARGET_TRIPLET": "x64-windows" }, "hidden": true }, { - "name": "x64-freebsd", + "name": "x64-windows-static", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-freebsd" + "MSVC_RUNTIME_DYNAMIC": "OFF", + "VCPKG_TARGET_TRIPLET": "x64-windows-static" }, "hidden": true }, + { - "name": "ci-ninja-x64-windows-release", - "inherits": ["ci", "ninja", "x64-windows", "release"] + "name": "ci-make-x64-linux-release", + "inherits": ["ci", "make", "x64-linux", "release"] }, { - "name": "ci-ninja-x64-windows-debug", - "inherits": ["ci", "ninja", "x64-windows", "debug"] + "name": "ci-make-x64-linux-debug", + "inherits": ["ci", "make", "x64-linux", "debug"] }, { - "name": "ci-ninja-x64-windows-static-release", - "inherits": ["ci", "ninja", "x64-windows-static", "release"] + "name": "ci-make-x64-freebsd-release", + "inherits": ["ci", "make", "x64-freebsd", "release"] }, { - "name": "ci-ninja-x64-windows-static-debug", - "inherits": ["ci", "ninja", "x64-windows-static", "debug"] + "name": "ci-make-x64-freebsd-debug", + "inherits": ["ci", "make", "x64-freebsd", "debug"] + }, + { + "name": "ci-ninja-x64-freebsd-release", + "inherits": ["ci", "ninja", "x64-freebsd", "release"] + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "inherits": ["ci", "ninja", "x64-freebsd", "debug"] }, { "name": "ci-ninja-x64-linux-release", @@ -100,28 +114,28 @@ "inherits": ["ci", "ninja", "x64-linux", "debug"] }, { - "name": "ci-ninja-x64-freebsd-release", - "inherits": ["ci", "ninja", "x64-freebsd", "release"] + "name": "ci-ninja-x64-windows-release", + "inherits": ["ci", "ninja", "x64-windows", "release"] }, { - "name": "ci-ninja-x64-freebsd-debug", - "inherits": ["ci", "ninja", "x64-freebsd", "debug"] + "name": "ci-ninja-x64-windows-debug", + "inherits": ["ci", "ninja", "x64-windows", "debug"] }, { - "name": "ci-ninjamulti-x64-windows-release", - "inherits": ["ci", "ninjamulti", "x64-windows", "release"] + "name": "ci-ninja-x64-windows-static-release", + "inherits": ["ci", "ninja", "x64-windows-static", "release"] }, { - "name": "ci-ninjamulti-x64-windows-debug", - "inherits": ["ci", "ninjamulti", "x64-windows", "debug"] + "name": "ci-ninja-x64-windows-static-debug", + "inherits": ["ci", "ninja", "x64-windows-static", "debug"] }, { - "name": "ci-ninjamulti-x64-windows-static-release", - "inherits": ["ci", "ninjamulti", "x64-windows-static", "release"] + "name": "ci-ninjamulti-x64-freebsd-release", + "inherits": ["ci", "ninjamulti", "x64-freebsd", "release"] }, { - "name": "ci-ninjamulti-x64-windows-static-debug", - "inherits": ["ci", "ninjamulti", "x64-windows-static", "debug"] + "name": "ci-ninjamulti-x64-freebsd-debug", + "inherits": ["ci", "ninjamulti", "x64-freebsd", "debug"] }, { "name": "ci-ninjamulti-x64-linux-release", @@ -132,12 +146,20 @@ "inherits": ["ci", "ninjamulti", "x64-linux", "debug"] }, { - "name": "ci-ninjamulti-x64-freebsd-release", - "inherits": ["ci", "ninjamulti", "x64-freebsd", "release"] + "name": "ci-ninjamulti-x64-windows-release", + "inherits": ["ci", "ninjamulti", "x64-windows", "release"] }, { - "name": "ci-ninjamulti-x64-freebsd-debug", - "inherits": ["ci", "ninjamulti", "x64-freebsd", "debug"] + "name": "ci-ninjamulti-x64-windows-debug", + "inherits": ["ci", "ninjamulti", "x64-windows", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "inherits": ["ci", "ninjamulti", "x64-windows-static", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "inherits": ["ci", "ninjamulti", "x64-windows-static", "debug"] } ], "buildPresets": [ @@ -152,23 +174,33 @@ "configuration": "Release" }, { - "name": "ci-ninja-x64-windows-debug", - "configurePreset": "ci-ninja-x64-windows-debug", + "name": "ci-make-x64-freebsd-debug", + "configurePreset": "ci-make-x64-freebsd-debug", "configuration": "Debug" }, { - "name": "ci-ninja-x64-windows-release", - "configurePreset": "ci-ninja-x64-windows-release", + "name": "ci-make-x64-freebsd-release", + "configurePreset": "ci-make-x64-freebsd-release", "configuration": "Release" }, { - "name": "ci-ninja-x64-windows-static-debug", - "configurePreset": "ci-ninja-x64-windows-static-debug", + "name": "ci-make-x64-linux-debug", + "configurePreset": "ci-make-x64-linux-debug", "configuration": "Debug" }, { - "name": "ci-ninja-x64-windows-static-release", - "configurePreset": "ci-ninja-x64-windows-static-release", + "name": "ci-make-x64-linux-release", + "configurePreset": "ci-make-x64-linux-release", + "configuration": "Release" + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "configurePreset": "ci-ninja-x64-freebsd-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninja-x64-freebsd-release", + "configurePreset": "ci-ninja-x64-freebsd-release", "configuration": "Release" }, { @@ -182,33 +214,33 @@ "configuration": "Release" }, { - "name": "ci-ninja-x64-freebsd-debug", - "configurePreset": "ci-ninja-x64-freebsd-debug", + "name": "ci-ninja-x64-windows-debug", + "configurePreset": "ci-ninja-x64-windows-debug", "configuration": "Debug" }, { - "name": "ci-ninja-x64-freebsd-release", - "configurePreset": "ci-ninja-x64-freebsd-release", + "name": "ci-ninja-x64-windows-release", + "configurePreset": "ci-ninja-x64-windows-release", "configuration": "Release" }, { - "name": "ci-ninjamulti-x64-windows-debug", - "configurePreset": "ci-ninjamulti-x64-windows-debug", + "name": "ci-ninja-x64-windows-static-debug", + "configurePreset": "ci-ninja-x64-windows-static-debug", "configuration": "Debug" }, { - "name": "ci-ninjamulti-x64-windows-release", - "configurePreset": "ci-ninjamulti-x64-windows-release", + "name": "ci-ninja-x64-windows-static-release", + "configurePreset": "ci-ninja-x64-windows-static-release", "configuration": "Release" }, { - "name": "ci-ninjamulti-x64-windows-static-debug", - "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "name": "ci-ninjamulti-x64-freebsd-debug", + "configurePreset": "ci-ninjamulti-x64-freebsd-debug", "configuration": "Debug" }, { - "name": "ci-ninjamulti-x64-windows-static-release", - "configurePreset": "ci-ninjamulti-x64-windows-static-release", + "name": "ci-ninjamulti-x64-freebsd-release", + "configurePreset": "ci-ninjamulti-x64-freebsd-release", "configuration": "Release" }, { @@ -222,13 +254,23 @@ "configuration": "Release" }, { - "name": "ci-ninjamulti-x64-freebsd-debug", - "configurePreset": "ci-ninjamulti-x64-freebsd-debug", + "name": "ci-ninjamulti-x64-windows-debug", + "configurePreset": "ci-ninjamulti-x64-windows-debug", "configuration": "Debug" }, { - "name": "ci-ninjamulti-x64-freebsd-release", - "configurePreset": "ci-ninjamulti-x64-freebsd-release", + "name": "ci-ninjamulti-x64-windows-release", + "configurePreset": "ci-ninjamulti-x64-windows-release", + "configuration": "Release" + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "configuration": "Debug" + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "configurePreset": "ci-ninjamulti-x64-windows-static-release", "configuration": "Release" } ], @@ -252,23 +294,33 @@ "hidden": true }, { - "name": "ci-ninja-x64-windows-debug", - "configurePreset": "ci-ninja-x64-windows-debug", + "name": "ci-make-x64-freebsd-debug", + "configurePreset": "ci-make-x64-freebsd-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninja-x64-windows-release", - "configurePreset": "ci-ninja-x64-windows-release", + "name": "ci-make-x64-freebsd-release", + "configurePreset": "ci-make-x64-freebsd-release", "inherits": ["ci", "release"] }, { - "name": "ci-ninja-x64-windows-static-debug", - "configurePreset": "ci-ninja-x64-windows-static-debug", + "name": "ci-make-x64-linux-debug", + "configurePreset": "ci-make-x64-linux-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninja-x64-windows-static-release", - "configurePreset": "ci-ninja-x64-windows-static-release", + "name": "ci-make-x64-linux-release", + "configurePreset": "ci-make-x64-linux-release", + "inherits": ["ci", "release"] + }, + { + "name": "ci-ninja-x64-freebsd-debug", + "configurePreset": "ci-ninja-x64-freebsd-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninja-x64-freebsd-release", + "configurePreset": "ci-ninja-x64-freebsd-release", "inherits": ["ci", "release"] }, { @@ -282,33 +334,33 @@ "inherits": ["ci", "release"] }, { - "name": "ci-ninja-x64-freebsd-debug", - "configurePreset": "ci-ninja-x64-freebsd-debug", + "name": "ci-ninja-x64-windows-debug", + "configurePreset": "ci-ninja-x64-windows-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninja-x64-freebsd-release", - "configurePreset": "ci-ninja-x64-freebsd-release", + "name": "ci-ninja-x64-windows-release", + "configurePreset": "ci-ninja-x64-windows-release", "inherits": ["ci", "release"] }, { - "name": "ci-ninjamulti-x64-windows-debug", - "configurePreset": "ci-ninjamulti-x64-windows-debug", + "name": "ci-ninja-x64-windows-static-debug", + "configurePreset": "ci-ninja-x64-windows-static-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninjamulti-x64-windows-release", - "configurePreset": "ci-ninjamulti-x64-windows-release", + "name": "ci-ninja-x64-windows-static-release", + "configurePreset": "ci-ninja-x64-windows-static-release", "inherits": ["ci", "release"] }, { - "name": "ci-ninjamulti-x64-windows-static-debug", - "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "name": "ci-ninjamulti-x64-freebsd-debug", + "configurePreset": "ci-ninjamulti-x64-freebsd-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninjamulti-x64-windows-static-release", - "configurePreset": "ci-ninjamulti-x64-windows-static-release", + "name": "ci-ninjamulti-x64-freebsd-release", + "configurePreset": "ci-ninjamulti-x64-freebsd-release", "inherits": ["ci", "release"] }, { @@ -322,13 +374,23 @@ "inherits": ["ci", "release"] }, { - "name": "ci-ninjamulti-x64-freebsd-debug", - "configurePreset": "ci-ninjamulti-x64-freebsd-debug", + "name": "ci-ninjamulti-x64-windows-debug", + "configurePreset": "ci-ninjamulti-x64-windows-debug", "inherits": ["ci", "debug"] }, { - "name": "ci-ninjamulti-x64-freebsd-release", - "configurePreset": "ci-ninjamulti-x64-freebsd-release", + "name": "ci-ninjamulti-x64-windows-release", + "configurePreset": "ci-ninjamulti-x64-windows-release", + "inherits": ["ci", "release"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-debug", + "configurePreset": "ci-ninjamulti-x64-windows-static-debug", + "inherits": ["ci", "debug"] + }, + { + "name": "ci-ninjamulti-x64-windows-static-release", + "configurePreset": "ci-ninjamulti-x64-windows-static-release", "inherits": ["ci", "release"] } ] From fc120a11aaa1b2e461637408ec4bfca5dba7d696 Mon Sep 17 00:00:00 2001 From: "Schaich, Alonso" Date: Fri, 20 Oct 2023 16:35:23 +0900 Subject: [PATCH 23/25] Add make flows --- .github/workflows/build-and-test.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4853ff2..bf6c70b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -30,12 +30,23 @@ jobs: mono: '' os: 'windows-2022' VsDevShellArch: 'amd64' + + - generator: 'make' + vcpkg_target_triplet: 'x64-linux' + build_type: 'debug' + mono: 'mono' + os: 'ubuntu-22.04' + - generator: 'make' + vcpkg_target_triplet: 'x64-linux' + build_type: 'release' + mono: 'mono' + os: 'ubuntu-22.04' permissions: contents: read packages: write - runs-on: ${{ matrix.os }}-8-cores + runs-on: ${{ matrix.os }}-8-cores env: VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }} From dd0a6e302bcda4cdc21a29f0caa1fa90de50747e Mon Sep 17 00:00:00 2001 From: Schaich Alonso Date: Fri, 20 Oct 2023 08:13:30 +0000 Subject: [PATCH 24/25] Add visual studio 2022 project file CI runs --- .github/workflows/build-and-test.yml | 24 +++++ CMakePresets.json | 145 +++++++++++++++++++-------- 2 files changed, 127 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bf6c70b..0cee3da 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -41,6 +41,30 @@ jobs: build_type: 'release' mono: 'mono' os: 'ubuntu-22.04' + - generator: 'vs2022' + vcpkg_target_triplet: 'x64-windows' + build_type: 'debug' + mono: '' + os: 'windows-2022' + VsDevShellArch: 'amd64' + - generator: 'vs2022' + vcpkg_target_triplet: 'x64-windows' + build_type: 'release' + mono: '' + os: 'windows-2022' + VsDevShellArch: 'amd64' + - generator: 'vs2022' + vcpkg_target_triplet: 'x64-windows-static' + build_type: 'debug' + mono: '' + os: 'windows-2022' + VsDevShellArch: 'amd64' + - generator: 'vs2022' + vcpkg_target_triplet: 'x64-windows-static' + build_type: 'release' + mono: '' + os: 'windows-2022' + VsDevShellArch: 'amd64' permissions: contents: read diff --git a/CMakePresets.json b/CMakePresets.json index 8cbbae3..53f9608 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,7 +30,7 @@ }, "inherits": [ "base" ] }, - + { "name": "ci", "binaryDir": "${sourceDir}/build", @@ -51,6 +51,11 @@ "generator": "Ninja Multi-Config", "hidden": true }, + { + "name": "vs2022", + "generator": "Visual Studio 17 2022", + "hidden": true + }, { "name": "x64-freebsd", "cacheVariables": { @@ -80,86 +85,102 @@ }, "hidden": true }, - + { "name": "ci-make-x64-linux-release", - "inherits": ["ci", "make", "x64-linux", "release"] + "inherits": [ "ci", "make", "x64-linux", "release" ] }, { "name": "ci-make-x64-linux-debug", - "inherits": ["ci", "make", "x64-linux", "debug"] + "inherits": [ "ci", "make", "x64-linux", "debug" ] }, { "name": "ci-make-x64-freebsd-release", - "inherits": ["ci", "make", "x64-freebsd", "release"] + "inherits": [ "ci", "make", "x64-freebsd", "release" ] }, { "name": "ci-make-x64-freebsd-debug", - "inherits": ["ci", "make", "x64-freebsd", "debug"] + "inherits": [ "ci", "make", "x64-freebsd", "debug" ] }, { "name": "ci-ninja-x64-freebsd-release", - "inherits": ["ci", "ninja", "x64-freebsd", "release"] + "inherits": [ "ci", "ninja", "x64-freebsd", "release" ] }, { "name": "ci-ninja-x64-freebsd-debug", - "inherits": ["ci", "ninja", "x64-freebsd", "debug"] + "inherits": [ "ci", "ninja", "x64-freebsd", "debug" ] }, { "name": "ci-ninja-x64-linux-release", - "inherits": ["ci", "ninja", "x64-linux", "release"] + "inherits": [ "ci", "ninja", "x64-linux", "release" ] }, { "name": "ci-ninja-x64-linux-debug", - "inherits": ["ci", "ninja", "x64-linux", "debug"] + "inherits": [ "ci", "ninja", "x64-linux", "debug" ] }, { "name": "ci-ninja-x64-windows-release", - "inherits": ["ci", "ninja", "x64-windows", "release"] + "inherits": [ "ci", "ninja", "x64-windows", "release" ] }, { "name": "ci-ninja-x64-windows-debug", - "inherits": ["ci", "ninja", "x64-windows", "debug"] + "inherits": [ "ci", "ninja", "x64-windows", "debug" ] }, { "name": "ci-ninja-x64-windows-static-release", - "inherits": ["ci", "ninja", "x64-windows-static", "release"] + "inherits": [ "ci", "ninja", "x64-windows-static", "release" ] }, { "name": "ci-ninja-x64-windows-static-debug", - "inherits": ["ci", "ninja", "x64-windows-static", "debug"] + "inherits": [ "ci", "ninja", "x64-windows-static", "debug" ] }, { "name": "ci-ninjamulti-x64-freebsd-release", - "inherits": ["ci", "ninjamulti", "x64-freebsd", "release"] + "inherits": [ "ci", "ninjamulti", "x64-freebsd", "release" ] }, { "name": "ci-ninjamulti-x64-freebsd-debug", - "inherits": ["ci", "ninjamulti", "x64-freebsd", "debug"] + "inherits": [ "ci", "ninjamulti", "x64-freebsd", "debug" ] }, { "name": "ci-ninjamulti-x64-linux-release", - "inherits": ["ci", "ninjamulti", "x64-linux", "release"] + "inherits": [ "ci", "ninjamulti", "x64-linux", "release" ] }, { "name": "ci-ninjamulti-x64-linux-debug", - "inherits": ["ci", "ninjamulti", "x64-linux", "debug"] + "inherits": [ "ci", "ninjamulti", "x64-linux", "debug" ] }, { "name": "ci-ninjamulti-x64-windows-release", - "inherits": ["ci", "ninjamulti", "x64-windows", "release"] + "inherits": [ "ci", "ninjamulti", "x64-windows", "release" ] }, { "name": "ci-ninjamulti-x64-windows-debug", - "inherits": ["ci", "ninjamulti", "x64-windows", "debug"] + "inherits": [ "ci", "ninjamulti", "x64-windows", "debug" ] }, { "name": "ci-ninjamulti-x64-windows-static-release", - "inherits": ["ci", "ninjamulti", "x64-windows-static", "release"] + "inherits": [ "ci", "ninjamulti", "x64-windows-static", "release" ] }, { "name": "ci-ninjamulti-x64-windows-static-debug", - "inherits": ["ci", "ninjamulti", "x64-windows-static", "debug"] + "inherits": [ "ci", "ninjamulti", "x64-windows-static", "debug" ] + }, + { + "name": "ci-vs2022-x64-windows-release", + "inherits": [ "ci", "vs2022", "x64-windows", "release" ] + }, + { + "name": "ci-vs2022-x64-windows-debug", + "inherits": [ "ci", "vs2022", "x64-windows", "debug" ] + }, + { + "name": "ci-vs2022-x64-windows-static-release", + "inherits": [ "ci", "vs2022", "x64-windows-static", "release" ] + }, + { + "name": "ci-vs2022-x64-windows-static-debug", + "inherits": [ "ci", "vs2022", "x64-windows-static", "debug" ] } ], "buildPresets": [ @@ -272,6 +293,26 @@ "name": "ci-ninjamulti-x64-windows-static-release", "configurePreset": "ci-ninjamulti-x64-windows-static-release", "configuration": "Release" + }, + { + "name": "ci-vs2022-x64-windows-debug", + "configurePreset": "ci-vs2022-x64-windows-debug", + "configuration": "Debug" + }, + { + "name": "ci-vs2022-x64-windows-release", + "configurePreset": "ci-vs2022-x64-windows-release", + "configuration": "Release" + }, + { + "name": "ci-vs2022-x64-windows-static-debug", + "configurePreset": "ci-vs2022-x64-windows-static-debug", + "configuration": "Debug" + }, + { + "name": "ci-vs2022-x64-windows-static-release", + "configurePreset": "ci-vs2022-x64-windows-static-release", + "configuration": "Release" } ], "testPresets": [ @@ -296,102 +337,122 @@ { "name": "ci-make-x64-freebsd-debug", "configurePreset": "ci-make-x64-freebsd-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-make-x64-freebsd-release", "configurePreset": "ci-make-x64-freebsd-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-make-x64-linux-debug", "configurePreset": "ci-make-x64-linux-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-make-x64-linux-release", "configurePreset": "ci-make-x64-linux-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninja-x64-freebsd-debug", "configurePreset": "ci-ninja-x64-freebsd-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninja-x64-freebsd-release", "configurePreset": "ci-ninja-x64-freebsd-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninja-x64-linux-debug", "configurePreset": "ci-ninja-x64-linux-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninja-x64-linux-release", "configurePreset": "ci-ninja-x64-linux-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninja-x64-windows-debug", "configurePreset": "ci-ninja-x64-windows-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninja-x64-windows-release", "configurePreset": "ci-ninja-x64-windows-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninja-x64-windows-static-debug", "configurePreset": "ci-ninja-x64-windows-static-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninja-x64-windows-static-release", "configurePreset": "ci-ninja-x64-windows-static-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninjamulti-x64-freebsd-debug", "configurePreset": "ci-ninjamulti-x64-freebsd-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninjamulti-x64-freebsd-release", "configurePreset": "ci-ninjamulti-x64-freebsd-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninjamulti-x64-linux-debug", "configurePreset": "ci-ninjamulti-x64-linux-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninjamulti-x64-linux-release", "configurePreset": "ci-ninjamulti-x64-linux-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninjamulti-x64-windows-debug", "configurePreset": "ci-ninjamulti-x64-windows-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninjamulti-x64-windows-release", "configurePreset": "ci-ninjamulti-x64-windows-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] }, { "name": "ci-ninjamulti-x64-windows-static-debug", "configurePreset": "ci-ninjamulti-x64-windows-static-debug", - "inherits": ["ci", "debug"] + "inherits": [ "ci", "debug" ] }, { "name": "ci-ninjamulti-x64-windows-static-release", "configurePreset": "ci-ninjamulti-x64-windows-static-release", - "inherits": ["ci", "release"] + "inherits": [ "ci", "release" ] + }, + { + "name": "ci-vs2022-x64-windows-debug", + "configurePreset": "ci-vs2022-x64-windows-debug", + "inherits": [ "ci", "debug" ] + }, + { + "name": "ci-vs2022-x64-windows-release", + "configurePreset": "ci-vs2022-x64-windows-release", + "inherits": [ "ci", "release" ] + }, + { + "name": "ci-vs2022-x64-windows-static-debug", + "configurePreset": "ci-vs2022-x64-windows-static-debug", + "inherits": [ "ci", "debug" ] + }, + { + "name": "ci-vs2022-x64-windows-static-release", + "configurePreset": "ci-vs2022-x64-windows-static-release", + "inherits": [ "ci", "release" ] } ] } From fcffaca5f56f8342060ee9239d3f58472dfce903 Mon Sep 17 00:00:00 2001 From: Alonso Schaich Date: Fri, 20 Oct 2023 09:00:13 +0000 Subject: [PATCH 25/25] Build only the more common presets on pull requests --- .../{build-and-test.yml => all-presets.yml} | 4 +- .github/workflows/typical-presets.yml | 158 ++++++++++++++++++ 2 files changed, 159 insertions(+), 3 deletions(-) rename .github/workflows/{build-and-test.yml => all-presets.yml} (99%) create mode 100644 .github/workflows/typical-presets.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/all-presets.yml similarity index 99% rename from .github/workflows/build-and-test.yml rename to .github/workflows/all-presets.yml index 0cee3da..4f87339 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/all-presets.yml @@ -1,10 +1,8 @@ -name: TinyORM Tests +name: All Presets on: push: branches: [ "main" ] - pull_request: - branches: [ "*" ] workflow_dispatch: env: diff --git a/.github/workflows/typical-presets.yml b/.github/workflows/typical-presets.yml new file mode 100644 index 0000000..5f54821 --- /dev/null +++ b/.github/workflows/typical-presets.yml @@ -0,0 +1,158 @@ +name: Typical Presets + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "*" ] + workflow_dispatch: + +env: + VCPKG_BINARY_SOURCES: clear;nuget,GitHub,readwrite;nugettimeout,3600 + +jobs: + build: + strategy: + fail-fast: false + matrix: + vcpkg_target_triplet: ['x64-windows', 'x64-linux'] + build_type: ['release'] + include: + - vcpkg_target_triplet: 'x64-linux' + mono: 'mono' + os: 'ubuntu-22.04' + generator: 'make' + - vcpkg_target_triplet: 'x64-windows' + mono: '' + os: 'windows-2022' + VsDevShellArch: 'amd64' + generator: 'vs2022' + + permissions: + contents: read + packages: write + + runs-on: ${{ matrix.os }}-8-cores + + env: + VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }} + + steps: + - name: Update ubuntu repository + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo apt-get update + + - name: Install ubuntu icu dependencies + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo apt-get install autoconf-archive + + - name: Install ubuntu qtbase dependencies (documented) + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev + + - name: Install ubuntu qtbase dependencies (undocumented) + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo apt-get install libgl1-mesa-dev mesa-common-dev + + - name: Install ubuntu Ninja + if: ${{ matrix.os == 'ubuntu-22.04' }} + shell: bash + run: sudo sudo apt-get install ninja-build + + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Bootstrap VCPKG + shell: bash + run: ./vcpkg/bootstrap-vcpkg.sh + + - name: Setup NuGet + shell: bash + run: | + ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources add \ + -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "${{ github.repository_owner }}" \ + -password "${{ secrets.GITHUB_TOKEN }}" + ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + ${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources + + - name: Print VsDevShells + if: ${{ matrix.os == 'windows-2022' }} + shell: pwsh + run: | + & "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" + + - name: CMake Workflow (VsDevShell) + if: ${{ matrix.os == 'windows-2022' }} + shell: pwsh + run: | + $vsInstallationPath=(& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" -property "installationPath") + Import-Module "${vsInstallationPath}/Common7/Tools/Microsoft.VisualStudio.DevShell.dll" + # invoking vcvarsall leaves the shell in another directory... + pushd . + Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }} + popd + cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + + - name: CMake Workflow (non VsDevShell) + if: ${{ matrix.os != 'windows-2022' }} + shell: pwsh + run: | + cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }} + + - name: Archive VCPKG Log Files + if: always() + uses: actions/upload-artifact@v3 + with: + name: buildlogs + path: | + vcpkg/buildtrees/*/*.txt + vcpkg/buildtrees/*/*.log + + - name: Create Test Result Artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results (${{ matrix.vcpkg_target_triplet }}) + path: | + build/*.xml + + + + publish-teshresults: + name: Publish Test Results + needs: build + if: > + always() && + github.event.sender.login != 'dependabot[bot]' && + ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository ) + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: | + artifacts/**/*.xml