New cmakelists #41
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build windows-msvc | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
############################################################################################################### | |
vcpkg-build: | |
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}-vcpkg" | |
runs-on: windows-latest | |
env: | |
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}} | |
strategy: | |
fail-fast: false | |
matrix: | |
link: ["STATIC", "SHARED"] | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.) | |
build-type: ["Debug", "Release"] | |
# Support (none, openssl, botan-3, auto) | |
tls-provider: ["none", "openssl", "botan-3"] | |
steps: | |
- name: Checkout Trantor source code | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
# This step let nmake/ninja could work | |
- name: Setup MSVC-DEV-CMD | |
uses: ilammy/msvc-dev-cmd@v1 | |
- uses: actions/cache@v4 | |
id: vcpkg-cache | |
with: | |
path: | | |
~/AppData/Local/vcpkg/archives | |
c:/vcpkg/downloads | |
c:/vcpkg/buildtrees | |
c:/vcpkg/packages | |
d:/a/trantor/trantor/vcpkg-installed | |
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} | |
- name: Install vcpkg packages | |
if: steps.vcpkg-cache.outputs.cache-hit != 'true' | |
run: | | |
pwsh ./deps.windows.vcpkg.ps1 | |
- name: Configure Cmake [ vcpkg | SPDLOG OFF | C-ARES OFF ] | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake -B build -S . ` | |
-DCMAKE_TOOLCHAIN_FILE="c:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` | |
-DBUILD_SHARED_LIBS=$shared ` | |
-DBUILD_DEPENDENCIES=OFF ` | |
-DTRANTOR_USE_SPDLOG=OFF ` | |
-DTRANTOR_USE_C-ARES=OFF ` | |
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} ` | |
-DBUILD_TESTING=ON ` | |
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ` | |
-G "Visual Studio 17 2022" -T host=x64 -A x64 | |
- name: Build | |
working-directory: ./build | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake --build . --config ${{matrix.build-type}} --target ALL_BUILD | |
- name: Test | |
working-directory: ./build | |
run: | | |
ctest | |
- name: Configure Cmake [ vcpkg | SPDLOG ON | C-ARES ON ] | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake -B build -S . ` | |
-DCMAKE_TOOLCHAIN_FILE="c:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` | |
-DBUILD_SHARED_LIBS=$shared ` | |
-DBUILD_DEPENDENCIES=OFF ` | |
-DTRANTOR_USE_SPDLOG=ON ` | |
-DTRANTOR_USE_C-ARES=ON ` | |
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} ` | |
-DBUILD_TESTING=ON ` | |
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ` | |
-G "Visual Studio 17 2022" -T host=x64 -A x64 | |
- name: Build | |
working-directory: ./build | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake --build . --config ${{matrix.build-type}} --target ALL_BUILD | |
- name: Test | |
working-directory: ./build | |
run: | | |
ctest | |
############################################################################################################### | |
conan-build: | |
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}-conan" | |
runs-on: windows-latest | |
env: | |
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}} | |
strategy: | |
fail-fast: false | |
matrix: | |
link: ["STATIC", "SHARED"] | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.) | |
build-type: ["Debug", "Release"] | |
# Support (none, openssl, botan-3, auto) | |
tls-provider: ["none", "openssl"] | |
steps: | |
- name: Checkout Trantor source code | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
# This step let nmake/ninja could work | |
- name: Setup MSVC-DEV-CMD | |
uses: ilammy/msvc-dev-cmd@v1 | |
- uses: actions/cache@v4 | |
id: conan-cache | |
with: | |
path: | | |
~\AppData\Local\pip\Cache | |
~\.conan2 | |
key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.txt') }} | |
- name: Install conan packages | |
run: | | |
pwsh deps.windows.conan.ps1 | |
- name: Configure Cmake [ conan | SPDLOG OFF | C-ARES OFF ] | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake -B build -S . ` | |
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` | |
-DBUILD_SHARED_LIBS=$shared ` | |
-DBUILD_DEPENDENCIES=OFF ` | |
-DTRANTOR_USE_SPDLOG=OFF ` | |
-DTRANTOR_USE_C-ARES=OFF ` | |
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} ` | |
-DBUILD_TESTING=ON ` | |
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ` | |
-G "Visual Studio 17 2022" -T host=x64 -A x64 | |
- name: Build | |
working-directory: ./build | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake --build . --config ${{matrix.build-type}} --target ALL_BUILD | |
- name: Test | |
working-directory: ./build | |
run: | | |
ctest | |
- name: Clean build folder | |
run: | | |
Remove-Item -Recurse -Force build | |
- name: Install conan packages | |
run: | | |
pwsh deps.windows.conan.ps1 | |
- name: Configure Cmake [ conan | SPDLOG ON | C-ARES ON ] | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake -B build -S . ` | |
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` | |
-DBUILD_SHARED_LIBS=$shared ` | |
-DBUILD_DEPENDENCIES=OFF ` | |
-DTRANTOR_USE_SPDLOG=ON ` | |
-DTRANTOR_USE_C-ARES=ON ` | |
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} ` | |
-DBUILD_TESTING=ON ` | |
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ` | |
-G "Visual Studio 17 2022" -T host=x64 -A x64 | |
- name: Build | |
working-directory: ./build | |
# multi config build using --config to switch Release|Debug | |
run: | | |
cmake --build . --config ${{matrix.build-type}} --target ALL_BUILD | |
- name: Test | |
working-directory: ./build | |
run: | | |
ctest |