Skip to content

Commit 5872632

Browse files
Parallelize testing with/without SSL on Windows
1 parent 644b591 commit 5872632

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

.github/workflows/test.yaml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ jobs:
7575
(github.event_name == 'pull_request' &&
7676
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) ||
7777
(github.event_name == 'workflow_dispatch' && github.event.inputs.test_windows == 'true')
78+
strategy:
79+
matrix:
80+
config:
81+
- with_ssl: false
82+
name: without SSL
83+
- with_ssl: true
84+
name: with SSL
85+
name: windows ${{ matrix.config.name }}
7886
steps:
7987
- name: Prepare Git for Checkout on Windows
8088
run: |
@@ -90,24 +98,25 @@ jobs:
9098
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
9199
- name: Setup msbuild on windows
92100
uses: microsoft/setup-msbuild@v2
93-
- name: Install libraries
94-
run: |
95-
vcpkg install gtest curl zlib brotli
96-
choco install openssl
97-
98-
- name: Configure CMake with SSL
99-
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DHTTPLIB_TEST=ON -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=ON -DHTTPLIB_REQUIRE_BROTLI=ON
100-
- name: Build with with SSL
101-
run: cmake --build build --config Release
102-
- name: Run tests with SSL
101+
- name: Install vcpkg dependencies
102+
run: vcpkg install gtest curl zlib brotli
103+
- name: Install OpenSSL
104+
if: ${{ matrix.config.with_ssl }}
105+
run: choco install openssl
106+
- name: Configure CMake ${{ matrix.config.name }}
107+
run: >
108+
cmake -B build -S .
109+
-DCMAKE_BUILD_TYPE=Release
110+
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
111+
-DHTTPLIB_TEST=ON
112+
-DHTTPLIB_REQUIRE_ZLIB=ON
113+
-DHTTPLIB_REQUIRE_BROTLI=ON
114+
-DHTTPLIB_REQUIRE_OPENSSL=${{ matrix.config.with_ssl && 'ON' || 'OFF' }}
115+
- name: Build ${{ matrix.config.name }}
116+
run: cmake --build build --config Release -- /v:m /clp:ShowCommandLine
117+
- name: Run tests ${{ matrix.config.name }}
103118
run: ctest --output-on-failure --test-dir build -C Release
104119

105-
- name: Configure CMake without SSL
106-
run: cmake -B build-no-ssl -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DHTTPLIB_TEST=ON -DHTTPLIB_REQUIRE_OPENSSL=OFF -DHTTPLIB_REQUIRE_ZLIB=ON -DHTTPLIB_REQUIRE_BROTLI=ON
107-
- name: Build without SSL
108-
run: cmake --build build-no-ssl --config Release
109-
- name: Run tests without SSL
110-
run: ctest --output-on-failure --test-dir build-no-ssl -C Release
111120
env:
112121
VCPKG_ROOT: "C:/vcpkg"
113122
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

0 commit comments

Comments
 (0)