@@ -547,64 +547,88 @@ jobs:
547
547
with :
548
548
arch : ${{ matrix.msvcArch }}
549
549
toolset : ${{ startsWith(matrix.qt, '5') && '14.29' || '' }} # MSVC 14.38+ has many deprecation issues w/ Qt5.
550
- - name : Build
550
+ - name : Build w/ coverage instrumentation
551
+ if : matrix.toolchain != 'msvc'
552
+ env :
553
+ CMAKE_MESSAGE_LOG_LEVEL : VERBOSE
554
+ PROJECT_BUILD_ID : ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
555
+ run : |
556
+ cmake -D CMAKE_BUILD_TYPE=Release ^
557
+ -D ENABLE_COVERAGE=true ^
558
+ -D QT_HOST_PATH=%qtHostPath% ^
559
+ -D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
560
+ -G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/coverage"
561
+ cmake --build "%RUNNER_TEMP%/coverage" --verbose
562
+ - name : Build w/o coverage instrumentation
551
563
env :
552
564
CMAKE_MESSAGE_LOG_LEVEL : VERBOSE
553
- ENABLE_COVERAGE : ${{ matrix.toolchain == 'msvc' && 'false' || 'true' }}
554
565
PROJECT_BUILD_ID : ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
555
566
run : |
556
567
cmake -D CMAKE_BUILD_TYPE=Release ^
557
- -D ENABLE_COVERAGE=%ENABLE_COVERAGE% ^
568
+ -D ENABLE_COVERAGE=false ^
558
569
-D QT_HOST_PATH=%qtHostPath% ^
559
570
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
560
- -G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%"
561
- cmake --build "%RUNNER_TEMP%" --verbose
571
+ -G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/release "
572
+ cmake --build "%RUNNER_TEMP%/release " --verbose
562
573
- name : Capture build-output variables
563
574
id : post-build
564
575
shell : bash
565
576
run : |
566
- echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
577
+ echo "dokitVersion=$(cat "$RUNNER_TEMP/release/ version.txt")" | tee -a "$GITHUB_OUTPUT"
567
578
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } |
568
579
tee -a "$GITHUB_OUTPUT"
569
- - name : Install DLL for tests
580
+ - name : Install DLL for tests w/ coverage
581
+ if : matrix.toolchain != 'msvc'
570
582
run : |
571
583
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
572
584
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
573
- working-directory : ${{ runner.temp }}
574
- - name : Test # We can't execute arm64 binaries on an x86-64 host.
585
+ working-directory : ${{ runner.temp }}/coverage
586
+ - name : Install DLL for tests w/o coverage
587
+ run : |
588
+ copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
589
+ copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
590
+ working-directory : ${{ runner.temp }}/release
591
+ - name : Test w/ coverage # We can't execute arm64 binaries on an x86-64 host.
592
+ if : matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
593
+ run : ctest --output-on-failure --test-dir "%RUNNER_TEMP%/coverage" --verbose
594
+ - name : Test w/o coverage # We can't execute arm64 binaries on an x86-64 host.
575
595
if : matrix.arch != 'arm64'
576
- run : ctest --output-on-failure --test-dir "%RUNNER_TEMP%" --verbose
596
+ run : ctest --output-on-failure --test-dir "%RUNNER_TEMP%/release " --verbose
577
597
- name : Collate test coverage
578
598
if : matrix.toolchain != 'msvc'
579
- run : cmake --build "%RUNNER_TEMP%" --target coverage --verbose
599
+ run : cmake --build "%RUNNER_TEMP%/coverage " --target coverage --verbose
580
600
- name : Upload test results
581
601
if : matrix.arch != 'arm64' && fromJSON(steps.post-build.outputs.tap)
582
602
uses : actions/upload-artifact@v4
583
603
with :
584
- name : test-results-${{ steps.post-build.outputs.dokitVersion }}
585
- path : ${{ runner.temp }}/test/**/*.tap
604
+ name : wip-test-results-${{ steps.post-build.outputs.dokitVersion }} # \todo Remove wip when ready.
605
+ path : |
606
+ ${{ runner.temp }}/coverage/coverage.info
607
+ ${{ runner.temp }}/coverage/removeHtmlDates.sh
608
+ ${{ runner.temp }}/coverage/test/**/*.tap
609
+ ${{ runner.temp }}/release/test/**/*.tap
586
610
if-no-files-found : error
587
611
- name : Make portable
588
612
if : matrix.arch != 'arm64'
589
- run : cmake --build "%RUNNER_TEMP%" --target cli-portable
613
+ run : cmake --build "%RUNNER_TEMP%/release " --target cli-portable
590
614
- name : Check portable version
591
615
if : matrix.arch != 'arm64'
592
616
shell : bash
593
- run : ' "$RUNNER_TEMP/portable/dokit.exe" --version'
617
+ run : ' "$RUNNER_TEMP/release/ portable/dokit.exe" --version'
594
618
- name : Upload artifacts
595
619
uses : actions/upload-artifact@v4
596
620
with :
597
621
name : dokit-${{ steps.post-build.outputs.dokitVersion }}
598
622
path : |
599
- ${{ runner.temp }}/src/lib/${{ matrix.dll }}
600
- ${{ runner.temp }}/src/cli/dokit.exe
623
+ ${{ runner.temp }}/release/ src/lib/${{ matrix.dll }}
624
+ ${{ runner.temp }}/release/ src/cli/dokit.exe
601
625
if-no-files-found : error
602
626
- name : Upload artifacts (portable)
603
627
if : matrix.arch != 'arm64'
604
628
uses : actions/upload-artifact@v4
605
629
with :
606
630
name : dokit-${{ steps.post-build.outputs.dokitVersion }}.portable
607
- path : ${{ runner.temp }}/portable
631
+ path : ${{ runner.temp }}/release/ portable
608
632
if-no-files-found : error
609
633
610
634
collate-test-results :
0 commit comments