This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new 8eb5c27d Improve Windows CI actions (#708)
8eb5c27d is described below

commit 8eb5c27dcfffde4955c5fa17f50e22d61d1754ad
Author: Stephen Webb <[email protected]>
AuthorDate: Sat Jun 6 11:00:50 2026 +1000

    Improve Windows CI actions (#708)
    
    * Regenerate vcpkg cache when using a different vcpkg reference
---
 .github/workflows/log4cxx-windows-static.yml  | 23 ++++++++++++-----------
 .github/workflows/log4cxx-windows.yml         |  7 +++++--
 src/cmake/win32_target_environment_path.cmake | 17 +++++++++--------
 src/test/cpp/CMakeLists.txt                   | 27 +++++----------------------
 4 files changed, 31 insertions(+), 43 deletions(-)

diff --git a/.github/workflows/log4cxx-windows-static.yml 
b/.github/workflows/log4cxx-windows-static.yml
index fc7c4af6..45bf7236 100644
--- a/.github/workflows/log4cxx-windows-static.yml
+++ b/.github/workflows/log4cxx-windows-static.yml
@@ -20,16 +20,18 @@ jobs:
   job:
     name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
     runs-on: ${{ matrix.os }}
-    timeout-minutes: 38
     strategy:
       fail-fast: false
       matrix:
-        name: [windows-2022, windows-2025]
+        name: [windows-2022, windows-2025-fmt]
         include:
           - name: windows-2022
             os: windows-2022
+            vcpkg_ref: 2025.07.25
           - name: windows-2025
             os: windows-2025
+            vcpkg_options: fmt
+            vcpkg_ref: 2026.05.25
 
     steps:
     - uses: actions/checkout@v4
@@ -42,7 +44,7 @@ jobs:
       uses: actions/cache@v3
       with:
         path: vcpkg
-        key: ${{ runner.os }}-${{ matrix.name }}-cache-x64-static
+        key: ${{ matrix.name }}-${{ matrix.vcpkg_ref }}-x64-static
 
     - name: 'Checkout VCPKG'
       if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
@@ -50,7 +52,7 @@ jobs:
       with:
         repository: microsoft/vcpkg
         path: vcpkg
-        ref: 2025.07.25
+        ref: ${{ matrix.vcpkg_ref }}
 
     - name: 'Configure Dependencies'
       if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
@@ -59,7 +61,7 @@ jobs:
       run: |
         cd vcpkg
         ./bootstrap-vcpkg.bat
-        ./vcpkg install apr apr-util --triplet=x64-windows-static
+        ./vcpkg install apr apr-util ${{ matrix.vcpkg_options }} 
--triplet=x64-windows-static
 
     - name: 'Install zip'
       id: install-zip
@@ -71,10 +73,7 @@ jobs:
     - name: 'run cmake - static'
       shell: pwsh
       run: |
-        $THISDIR=Get-Location
-        cd main
-        mkdir build
-        cd build
+        $ROOT=Get-Location
         cmake `
             -DLOG4CXX_TEST_ONLY_BUILD=1 `
             -DVCPKG_TARGET_TRIPLET=x64-windows-static `
@@ -82,12 +81,14 @@ jobs:
             -DLOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER=on `
             -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin `
             
"-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-            ..
+           -S "$ROOT/main" `
+           -B "$ROOT/build"
 
-        cmake --build .
+        cmake --build "$ROOT/build" --config Debug
 
     - name: run unit tests
       shell: pwsh
+      timeout-minutes: 10
       run: |
         cd main
         cd build
diff --git a/.github/workflows/log4cxx-windows.yml 
b/.github/workflows/log4cxx-windows.yml
index b144dcc2..1c368915 100644
--- a/.github/workflows/log4cxx-windows.yml
+++ b/.github/workflows/log4cxx-windows.yml
@@ -29,16 +29,19 @@ jobs:
             os: windows-2022
             qt: OFF
             next_abi: OFF
+            vcpkg_ref: 2025.07.25
           - name: windows-2025-fmt
             os: windows-2025
             qt: OFF
             next_abi: ON
             vcpkg_options: fmt
+            vcpkg_ref: 2026.05.25
           - name: windows-2025-qt
             os: windows-2025
             qt: ON
             vcpkg_options: qtbase
             next_abi: OFF
+            vcpkg_ref: 2026.05.25
 
     steps:
     - uses: actions/checkout@v4
@@ -51,7 +54,7 @@ jobs:
       uses: actions/cache@v4
       with:
         path: vcpkg
-        key: ${{ runner.os }}-${{ matrix.name }}-cache-x64
+        key: ${{ matrix.name }}-${{ matrix.vcpkg_ref }}-x64
 
     - name: 'Checkout VCPKG'
       if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
@@ -59,7 +62,7 @@ jobs:
       with:
         repository: microsoft/vcpkg
         path: vcpkg
-        ref: 2026.05.25
+        ref: ${{ matrix.vcpkg_ref }}
 
     - name: 'Configure Dependencies'
       if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
diff --git a/src/cmake/win32_target_environment_path.cmake 
b/src/cmake/win32_target_environment_path.cmake
index 1ee73ef3..a0733f53 100644
--- a/src/cmake/win32_target_environment_path.cmake
+++ b/src/cmake/win32_target_environment_path.cmake
@@ -2,14 +2,15 @@
 function(get_target_environment_path varName)
   get_filename_component(APR_DLL_DIR "${APR_DLL}" DIRECTORY)
   get_filename_component(APR_UTIL_DLL_DIR "${APR_UTIL_DLL}" DIRECTORY)
-  get_filename_component(EXPAT_LIB_DIR "${EXPAT_LIBRARY}" DIRECTORY)
-
-
-  set(EXPAT_DLL_DIR "${EXPAT_LIB_DIR}/../bin")
-  set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")
-  set(PATH_FOR_TESTS 
${CMAKE_PROGRAM_PATH};${APR_DLL_DIR};${APR_UTIL_DLL_DIR};${LOG4CXX_DLL_DIR};${EXPAT_DLL_DIR}\;)
+  set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>")
+  set(PATH_FOR_TESTS "${LOG4CXX_DLL_DIR}" "${CMAKE_PROGRAM_PATH}" 
"${APR_DLL_DIR}" "${APR_UTIL_DLL_DIR}")
+  if(EXPAT_LIBRARY)
+    get_filename_component(EXPAT_LIB_DIR "${EXPAT_LIBRARY}" DIRECTORY)
+    set(EXPAT_DLL_DIR "${EXPAT_LIB_DIR}/../bin")
+    list(APPEND PATH_FOR_TESTS "${EXPAT_DLL_DIR}")
+  endif()
   if(LOG4CXX_QT_SUPPORT)
-    list(APPEND PATH_FOR_TESTS "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx-qt>>\;")
+    list(APPEND PATH_FOR_TESTS "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx-qt>>")
   endif(LOG4CXX_QT_SUPPORT)
   list(REMOVE_DUPLICATES PATH_FOR_TESTS)
 
@@ -23,7 +24,7 @@ function(get_target_environment_path varName)
   # properly interpret the PATH
   set(NORMAL_PATH $ENV{PATH})
   set(ESCAPED_PATH "")
-  foreach( ENTRY ${PATH_FOR_TESTS}${NORMAL_PATH} )
+  foreach( ENTRY ${PATH_FOR_TESTS};${NORMAL_PATH} )
     set(ESCAPED_PATH "${ESCAPED_PATH}${ENTRY}\\\;")
   endforeach()
   set(${varName} ${ESCAPED_PATH} PARENT_SCOPE)
diff --git a/src/test/cpp/CMakeLists.txt b/src/test/cpp/CMakeLists.txt
index 28ebd7cf..60835675 100644
--- a/src/test/cpp/CMakeLists.txt
+++ b/src/test/cpp/CMakeLists.txt
@@ -163,19 +163,10 @@ foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
     if(WIN32)
         set_target_properties(${testName} PROPERTIES
           VS_DEBUGGER_WORKING_DIRECTORY ${UNIT_TEST_WORKING_DIR}
-          FOLDER UnitTests
-        )
-        set_target_properties(${testName} PROPERTIES
           VS_DEBUGGER_COMMAND_ARGUMENTS "-v"
+          FOLDER UnitTests
         )
-        if(${testName} STREQUAL socketservertestcase)
-            set_target_properties(${testName} PROPERTIES
-              VS_DEBUGGER_ENVIRONMENT 
"SOCKET_SERVER_PARAMETER_FILE=${START_SOCKET_SERVER_PARAMETER_FILE}\nPATH=${ESCAPED_PATH}"
-            )
-            set_tests_properties(socketservertestcase PROPERTIES
-                ENVIRONMENT 
"SOCKET_SERVER_PARAMETER_FILE=${START_SOCKET_SERVER_PARAMETER_FILE};PATH=${ESCAPED_PATH}"
-            )
-        elseif(${testName} STREQUAL optionconvertertestcase)
+        if(${testName} STREQUAL optionconvertertestcase)
             set_target_properties(${testName} PROPERTIES
               VS_DEBUGGER_ENVIRONMENT 
"TOTO=wonderful\nkey1=value1\nkey2=value2\nPATH=${ESCAPED_PATH}"
             )
@@ -184,10 +175,10 @@ foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
            )
         else()
             set_target_properties(${testName} PROPERTIES
-              VS_DEBUGGER_ENVIRONMENT 
"key1=value1\nkey2=value2\nPATH=${ESCAPED_PATH}"
+              VS_DEBUGGER_ENVIRONMENT "PATH=${ESCAPED_PATH}"
             )
            set_tests_properties(${testName} PROPERTIES
-                ENVIRONMENT "key1=value1;key2=value2;PATH=${ESCAPED_PATH}"
+                ENVIRONMENT "PATH=${ESCAPED_PATH}"
            )
         endif()
         if(NOT BUILD_SHARED_LIBS)
@@ -198,18 +189,10 @@ foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
             set_target_properties(${testName} PROPERTIES MSVC_RUNTIME_LIBRARY 
"MultiThreaded$<$<CONFIG:Debug>:Debug>")
         endif()
     else()
-        if(${testName} STREQUAL socketservertestcase)
-            set_tests_properties(socketservertestcase PROPERTIES
-                ENVIRONMENT 
"SOCKET_SERVER_PARAMETER_FILE=${START_SOCKET_SERVER_PARAMETER_FILE}"
-            )
-        elseif(${testName} STREQUAL optionconvertertestcase)
+        if(${testName} STREQUAL optionconvertertestcase)
             set_tests_properties(optionconvertertestcase PROPERTIES
                 ENVIRONMENT "TOTO=wonderful;key1=value1;key2=value2"
             )
-        else()
-           set_tests_properties(${testName} PROPERTIES
-                ENVIRONMENT "key1=value1;key2=value2"
-           )
         endif()
     endif()
 endforeach()

Reply via email to