diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0e2bff1aba..690d22eb00 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -98,14 +98,21 @@ jobs: run: git diff --exit-code working-directory: src/modules/ekf2/test/change_indication - tests-windows-msvc: - name: Unit Tests (windows-msvc) + tests-windows: + name: Unit Tests (windows-${{ matrix.compiler }}) # Native Windows host is required: the gtest binaries under # platforms/posix/src/px4/windows/tests/ exercise the _MSC_VER paths # in the shim headers and the MSVC-only sources (socket_msvc.cpp, # sys/time.cpp, etc.). The shim CMakeLists is gated on WIN32 in # platforms/posix/CMakeLists.txt, so a Linux runner cannot stand in. + # The compiler axis covers both native MSVC (cl.exe) and the LLVM + # clang-cl.exe driver against the same MSVC headers/CRT so we catch + # toolchain-specific shim regressions before they hit the SITL build. runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + compiler: [msvc, clang-cl] steps: - uses: actions/checkout@v6 with: @@ -142,11 +149,16 @@ jobs: # via px4_posix_windows_add_tests() (see platforms/posix/CMakeLists.txt). # Pin Python3_ROOT_DIR to the setup-python interpreter so cmake's # find_package(Python3) does not pick the runner image's other Python - # where kconfiglib is not installed. We invoke cmake directly here - # rather than `make px4_sitl_test` so we only configure and can then - # build a narrow set of targets in the next step. + # where kconfiglib is not installed. The CC/CXX env vars decide which + # toolchain CMake picks: empty for native MSVC (the default cl.exe + # discovered via vcvars), or clang-cl.exe for the LLVM driver. We + # invoke cmake directly here rather than `make px4_sitl_test` so we + # only configure and can then build a narrow set of targets next. - name: Configure (px4_sitl_test) shell: pwsh + env: + CC: ${{ matrix.compiler == 'clang-cl' && 'clang-cl' || '' }} + CXX: ${{ matrix.compiler == 'clang-cl' && 'clang-cl' || '' }} run: | cmake -S . -B build/px4_sitl_test -G Ninja ` -DCONFIG=px4_sitl_test `