ci: Switch to dynamic library linkage in native Windows job

This change significantly reduces the vcpkg binary cache size, improving
CI caching performance.
This commit is contained in:
Hennadii Stepanov 2025-04-02 17:47:10 +01:00
parent 639279e86a
commit 7967fe5bfd
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -156,7 +156,7 @@ jobs:
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }} key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
windows-native: windows-native-dll:
name: ${{ matrix.job-name }} name: ${{ matrix.job-name }}
runs-on: windows-2022 runs-on: windows-2022
@ -202,7 +202,6 @@ jobs:
- name: Using vcpkg with MSBuild - name: Using vcpkg with MSBuild
run: | run: |
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake" echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake"
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows-static.cmake"
# Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0. # Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake" sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"
@ -221,7 +220,7 @@ jobs:
- name: Generate build system - name: Generate build system
run: | run: |
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }} cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }}
- name: Save vcpkg binary cache - name: Save vcpkg binary cache
uses: actions/cache/save@v4 uses: actions/cache/save@v4
@ -238,6 +237,8 @@ jobs:
- name: Run test suite - name: Run test suite
if: matrix.job-type == 'standard' if: matrix.job-type == 'standard'
working-directory: build working-directory: build
env:
QT_PLUGIN_PATH: '${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins'
run: | run: |
ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release