Author: brane Date: Sun Jun 8 05:23:03 2025 New Revision: 1926240 URL: http://svn.apache.org/viewvc?rev=1926240&view=rev Log: In the GitHub workflow for Windows, define the cross target platform in the matrix instead of in separate steps. Then build both release and debug versions in the same job.
* .github/workflows/windows-cmake.yml: - include separate triplate/platform pairs in the matrix; - remove the steps that define SERF_WIN_PLATFORM; - set the build platform from matrix.platorm instead of the environment; - add expicit release and debug build/test steps. Suggested by: rinrab Modified: serf/trunk/.github/workflows/windows-cmake.yml Modified: serf/trunk/.github/workflows/windows-cmake.yml URL: http://svn.apache.org/viewvc/serf/trunk/.github/workflows/windows-cmake.yml?rev=1926240&r1=1926239&r2=1926240&view=diff ============================================================================== --- serf/trunk/.github/workflows/windows-cmake.yml (original) +++ serf/trunk/.github/workflows/windows-cmake.yml Sun Jun 8 05:23:03 2025 @@ -12,14 +12,15 @@ on: jobs: build: strategy: - matrix: - os: [windows-latest] - build-type: [Debug, Release] - triplet: - - x64-windows - - x86-windows - generator: [ "Visual Studio 17 2022" ] fail-fast: false + matrix: + os: windows-latest + generator: Visual Studio 17 2022 + include: + - triplet: x64-windows + platform: x64 + - triplet: x86-windows + platform: Win32 runs-on: ${{ matrix.os }} @@ -34,33 +35,34 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Set build environment for x86 - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('SERF_WIN_PLATFORM', 'Win32'); - if: startsWith(matrix.triplet, 'x86-') - - - name: Set build environment for x64 - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('SERF_WIN_PLATFORM', 'x64'); - if: startsWith(matrix.triplet, 'x64-') - - name: Install dependencies run: vcpkg install --triplet ${{ matrix.triplet }} apr apr-util zlib openssl brotli - uses: actions/checkout@v3 - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -G "${{ matrix.generator }}" -DCMAKE_GENERATOR_PLATFORM=${{ env.SERF_WIN_PLATFORM }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DAPR_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} -DAPRUtil_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} -DOPENSSL_ROOT_DIR=C:/vcpkg/installed/${{ matrix.triplet }} -DZLIB_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} -DBrotli_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} + run: > + cmake -B ${{github.workspace}}/build + -G "${{ matrix.generator }}" + --toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake + --install-prefix ${{github.workspace}}/install + -DCMAKE_GENERATOR_PLATFORM=${{ matrix.platform }} + -DAPR_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} + -DAPRUtil_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} + -DOPENSSL_ROOT_DIR=C:/vcpkg/installed/${{ matrix.triplet }} + -DZLIB_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} + -DBrotli_ROOT=C:/vcpkg/installed/${{ matrix.triplet }} - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }} + - name: Build (Release) + run: cmake --build ${{github.workspace}}/build --config Release -j + + - name: Build (Debug) + run: cmake --build ${{github.workspace}}/build --config Debug -j + + - name: Test (Release) + working-directory: ${{github.workspace}}/build + run: ctest -C Release --output-on-failure - - name: Test + - name: Test (Debug) working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{ matrix.build-type }} --output-on-failure + run: ctest -C Debug --output-on-failure