99
1010jobs :
1111 build :
12- name : CMake on ${{ matrix.os }} with ${{ matrix.dependencies }}
12+ name : CMake on ${{ matrix.os }}
1313 runs-on : ${{ matrix.os }}
1414 strategy :
1515 fail-fast : false
1616 matrix :
1717 os : [macos-14, ubuntu-22.04, windows-2022]
18- dependencies : [submodule, vcpkg]
1918 steps :
2019 - name : Checkout source
2120 uses : actions/checkout@v7
22- with :
23- submodules : ${{ matrix.dependencies == 'submodule' }}
2421
2522 - name : Mount vcpkg cache
26- if : matrix.dependencies == 'vcpkg'
2723 uses : actions/cache@v5
2824 with :
2925 path : " ~/.cache/vcpkg/archives"
3026 key : vcpkg-${{ matrix.os }}
3127
3228 - name : Default to x64-windows vcpkg triplet
33- if : matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
29+ if : runner.os == 'Windows'
3430 run : echo "VCPKG_DEFAULT_TRIPLET=x64-windows" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
3531
3632 - name : Install vcpkg dependencies
37- if : matrix.dependencies == 'vcpkg'
3833 run : vcpkg install benchmark civetweb curl[core] gtest zlib
3934
4035 - name : Generate German locale on Ubuntu
@@ -54,20 +49,12 @@ jobs:
5449 if : runner.os == 'macOS'
5550 run : brew install ninja
5651
57- - name : " Configure for Unix with internal dependencies"
58- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
59- run : cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build -DBUILD_SHARED_LIBS=ON
60-
61- - name : " Configure for Windows with internal dependencies"
62- if : matrix.dependencies == 'submodule' && runner.os == 'Windows'
63- run : cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build -DBUILD_SHARED_LIBS=ON
64-
6552 - name : " Configure for Unix with vcpkg dependencies"
66- if : matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
53+ if : runner.os != 'Windows'
6754 run : cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
6855
6956 - name : " Configure for Windows with vcpkg dependencies"
70- if : matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
57+ if : runner.os == 'Windows'
7158 run : cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
7259
7360 - name : " Build Debug"
@@ -94,20 +81,12 @@ jobs:
9481 - name : " Install Release"
9582 run : cmake --install ${{ github.workspace }}/_build --config Release
9683
97- - name : " Configure CMake import for Unix with internal dependencies"
98- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
99- run : cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
100-
101- - name : " Configure CMake import for Windows with internal dependencies"
102- if : matrix.dependencies == 'submodule' && runner.os == 'Windows'
103- run : cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
104-
10584 - name : " Configure CMake import for Unix with vcpkg dependencies"
106- if : matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
85+ if : runner.os != 'Windows'
10786 run : cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
10887
10988 - name : " Configure CMake import for Windows with vcpkg dependencies"
110- if : matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
89+ if : runner.os == 'Windows'
11190 run : cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
11291
11392 - name : " Build CMake import Debug"
@@ -117,21 +96,21 @@ jobs:
11796 run : cmake --build ${{ github.workspace }}/_import_cmake --config Release
11897
11998 - name : " Configure for Unix Shared Libs with internal dependencies"
120- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
121- run : cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install_shared -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build_shared
99+ if : runner.os != 'Windows'
100+ run : cmake "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install_shared -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build_shared
122101
123102 - name : " Build for Unix Shared Libs"
124- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
103+ if : runner.os != 'Windows'
125104 run : cmake --build ${{ github.workspace }}/_build_shared
126105
127106 - name : " Install for Unix Shared Libs"
128- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
107+ if : runner.os != 'Windows'
129108 run : cmake --install ${{ github.workspace }}/_build_shared
130109
131110 - name : " Configure pkg-config import for Unix"
132- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
133- run : cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/_install_shared -GNinja -S ${{ github.workspace }}/cmake/project-import-pkgconfig -B ${{ github.workspace }}/_import_pkgconfig
111+ if : runner.os != 'Windows'
112+ run : cmake "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/_install_shared -GNinja -S ${{ github.workspace }}/cmake/project-import-pkgconfig -B ${{ github.workspace }}/_import_pkgconfig
134113
135114 - name : " Build pkg-config import for Unix"
136- if : matrix.dependencies == 'submodule' && runner.os != 'Windows'
115+ if : runner.os != 'Windows'
137116 run : cmake --build ${{ github.workspace }}/_import_pkgconfig
0 commit comments