summaryrefslogtreecommitdiff
path: root/.github/workflows/windows.yml
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhsoting.net>2026-05-08 11:53:45 +0200
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2026-05-08 11:53:45 +0200
commitc3dce46c5f7cad6bc3cc91cc2c711ac089f25923 (patch)
treeabaac2b003b368aa5bde30a5b898a3f51e85db43 /.github/workflows/windows.yml
parentbc983f30186f3c204b1daea57b0057f93b74dde1 (diff)
New upstream version 1.0.1+dfsgupstream/1.0.1+dfsgupstream
Diffstat (limited to '.github/workflows/windows.yml')
-rw-r--r--.github/workflows/windows.yml117
1 files changed, 117 insertions, 0 deletions
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 0000000..ec8cee4
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,117 @@
+# Copyright (C) 2025 Sebastian Pipping <sebastian@pipping.org>
+# Licensed under the MIT license
+
+name: Build and test (Windows)
+
+on:
+ pull_request:
+ push:
+ schedule:
+ - cron: '0 2 * * 5' # Every Friday at 2am
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ windows:
+ name: Build and test (Windows)
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ # Visual Studio 2022, 32 bit
+ - runs-on: windows-2022
+ cmake_generator: Visual Studio 17 2022
+ common_cmake_args: -A Win32
+ uriparser_sln: uriparser.sln
+
+ # Visual Studio 2022, 64 bit
+ - runs-on: windows-2022
+ cmake_generator: Visual Studio 17 2022
+ common_cmake_args: -A x64
+ uriparser_sln: uriparser.sln
+
+ # Visual Studio 2026, 32 bit
+ - runs-on: windows-2025-vs2026
+ cmake_generator: Visual Studio 18 2026
+ common_cmake_args: -A Win32
+ uriparser_sln: uriparser.slnx
+
+ # Visual Studio 2026, 64 bit
+ - runs-on: windows-2025-vs2026
+ cmake_generator: Visual Studio 18 2026
+ common_cmake_args: -A x64
+ uriparser_sln: uriparser.slnx
+
+ runs-on: ${{ matrix.runs-on }}
+ defaults:
+ run:
+ shell: bash
+ env:
+ CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
+ COMMON_CMAKE_ARGS: ${{ matrix.common_cmake_args }}
+ GTEST_VERSION: 1.12.0
+ steps:
+
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
+
+ - name: Build dependency googletest
+ run: |-
+ set -x
+ curl -fsSL -o "release-${GTEST_VERSION}.zip" "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.zip"
+ unzip -q "release-${GTEST_VERSION}.zip"
+
+ cd "googletest-release-${GTEST_VERSION}"
+ cmake \
+ -G "${CMAKE_GENERATOR}" \
+ -DCVF_VERSION="${GTEST_VERSION}" \
+ ${COMMON_CMAKE_ARGS}
+ cmake --build . --config Release -- -m
+
+ # Enrich folder to make FindGTest.cmake happy
+ mkdir -p googletest/lib
+ cp -v lib/Release/{gtest,gtest_main}.lib googletest/lib/
+
+ - name: Configure
+ run: |-
+ cmake_args=(
+ -G "${CMAKE_GENERATOR}"
+ # NOTE: GTEST_ROOT is relative to source CMakeLists.txt, not the build directory
+ -DGTEST_ROOT="googletest-release-${GTEST_VERSION}/googletest"
+ -DURIPARSER_BUILD_DOCS=OFF
+ -DURIPARSER_BUILD_TESTS=ON
+ -DURIPARSER_MSVC_STATIC_CRT=ON
+ -DURIPARSER_WARNINGS_AS_ERRORS=ON
+ -S .
+ -B build/
+ ${COMMON_CMAKE_ARGS}
+ )
+ set -x
+ cmake "${cmake_args[@]}"
+
+ - name: Build
+ env:
+ uriparser_sln: ${{ matrix.uriparser_sln }}
+ run: |-
+ msbuild_args=(
+ -m
+ -property:Configuration=Release
+ )
+ set -x
+ cd build
+ MSBuild.exe "${msbuild_args[@]}" "${uriparser_sln}"
+
+ - name: Run tests
+ run: |-
+ ctest_args=(
+ --build-config Release
+ --no-tests=error
+ --output-on-failure
+ --parallel 2
+ )
+ set -x
+ cd build
+ ctest "${ctest_args[@]}"