Skip to content

Commit a9f84ec

Browse files
committed
Only enable test coverage for non-MSVC chains
1 parent d694df0 commit a9f84ec

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,16 @@ jobs:
514514
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
515515
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
516516
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
517-
- run: gcov.exe --version
518-
- run: C:\msys64\usr\bin\pacman --sync --noconfirm --verbose mingw-w64-x86_64-lcov
519-
- run: dir C:\msys64 /s
520517
- name: Upload aqtinstall log file
521518
if: failure()
522519
uses: actions/upload-artifact@v4
523520
with:
524521
name: aqtinstall-log-win-${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.qt }}
525522
path: aqtinstall.log
526523
if-no-files-found: error
524+
- name: Install LCOV
525+
if: toolchain != 'msvc'
526+
run: C:\msys64\usr\bin\pacman --sync --noconfirm --verbose mingw-w64-x86_64-lcov
527527
- name: Configure cross-compilation
528528
if: matrix.arch == 'arm64'
529529
shell: bash
@@ -539,11 +539,12 @@ jobs:
539539
- name: Build
540540
env:
541541
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
542+
ENABLE_COVERAGE: ${{ matrix.os == 'msvc' && 'false' || 'true' }}
542543
PROJECT_BUILD_ID: ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
543544
run: |
544545
cmake -D CMAKE_BUILD_TYPE=Release ^
545546
-D CODECOV_LCOV=C:\msys64\mingw64\bin\lcov ^
546-
-D ENABLE_COVERAGE=true ^
547+
-D ENABLE_COVERAGE=%ENABLE_COVERAGE% ^
547548
-D QT_HOST_PATH=%qtHostPath% ^
548549
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
549550
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%"
@@ -564,6 +565,7 @@ jobs:
564565
if: matrix.arch != 'arm64'
565566
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%" --verbose
566567
- name: Collate test coverage
568+
if: matrix.toolchain == 'msvc'
567569
run: cmake --build "%RUNNER_TEMP%" --target coverage
568570
- name: Upload test results
569571
if: matrix.arch != 'arm64' && fromJSON(steps.post-build.outputs.tap)

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ if (ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
4242
endif()
4343

4444
if (ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
45-
find_program(CODECOV_GCOV NAMES gcov gcov.exe)
46-
find_program(CODECOV_LCOV NAMES lcov lcov.exe)
45+
find_program(CODECOV_GCOV gcov)
46+
find_program(CODECOV_LCOV lcov)
4747
if (CODECOV_LCOV)
4848
message(STATUS "Found gcov ${CODECOV_GCOV}")
4949
message(STATUS "Found lcov ${CODECOV_LCOV}")

0 commit comments

Comments
 (0)