From 58ce79632f84a4c0898a0820d06bee605ec7c14f Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Sun, 22 Dec 2024 21:46:54 +1100 Subject: [PATCH 1/2] Disable lcov consistency checks on collation too Squashed commit of the following: commit 3c6aa159872e5937c559ae4e1d32274302948f67 Author: Paul Colby Date: Sun Dec 22 21:13:20 2024 +1100 Skip coverage for clang on macOS 13 commit 40b876414ce6869aa523d896bfaa360b32196ade Author: Paul Colby Date: Sun Dec 22 20:57:42 2024 +1100 Try configuring coverage for Clang on macOS 13 commit cad8379ff8f1bc33217d2b4ca01e30df333fed43 Author: Paul Colby Date: Sun Dec 22 20:45:17 2024 +1100 Re-instate remaining builds And see if we can support coverage on all macOS builds now. commit 5618980876876b7f9b407b68346b408f41a70058 Author: Paul Colby Date: Sun Dec 22 20:16:09 2024 +1100 Always append to .lcovrc commit 154635f8751896eae2f1fd5dd83093a653a2e16e Author: Paul Colby Date: Sun Dec 22 20:00:56 2024 +1100 Skip data integrity check when collating too commit 855f54d15c1af403ebbeff9366275f72660bd0c8 Author: Paul Colby Date: Sun Dec 22 19:44:34 2024 +1100 Skip Windows test results for now commit b2b8da0989936211ea7b70a168141e33a2e30cb9 Author: Paul Colby Date: Sun Dec 22 19:28:08 2024 +1100 Restore the Linux builds commit 29fe95f94213401503d381c2a7dc0382e4319d49 Author: Paul Colby Date: Sun Dec 22 19:08:56 2024 +1100 Correct Bash syntax commit 77dc0bf2c5369d956f5d7687631cff80f10e8c88 Author: Paul Colby Date: Sun Dec 22 18:51:37 2024 +1100 Install lcov dependencies commit 48fc7c6e9fa854503e582d8b4271553c4f9a79f4 Author: Paul Colby Date: Sun Dec 22 18:28:37 2024 +1100 Bump lcov to v2.2 when collating commit 944f8dd69b6bb48bd5a856ed53839b4b7b04318c Author: Paul Colby Date: Sun Dec 22 18:08:29 2024 +1100 Search for available lcov versions commit d6ce2619996e2b914d19ad4326e0b388b7892eb3 Author: Paul Colby Date: Sun Dec 22 17:59:48 2024 +1100 Try pinning lcov to v2.0 For compatabilty with Ubuntu. --- .github/workflows/build.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e24e2da7d..adcba1d96 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -240,7 +240,7 @@ jobs: PROJECT_BUILD_ID: "${{ github.run_number }}.${{ matrix.os }}.${{ steps.arch.outputs.buildId }}.\ ${{ matrix.cc }}.qt-${{ matrix.qt }}" run: | - # With coverage instrumentation. + # With coverage instrumentation (except macOS 13's llvm-lcov version does not support the --sources option) [[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] || cmake -D CMAKE_BUILD_TYPE=Release \ -D CODECOV_GCOV=/usr/local/bin/gcov-14 \ @@ -619,6 +619,8 @@ jobs: collate-test-results: needs: [ linux, mac, win ] runs-on: ubuntu-24.04 + env: + LCOV_VERSION: 2.2 # Should stay in-step, or ahead of, the Ubuntu, macOS and Windows versions. steps: - uses: actions/checkout@v4 - name: Install lcov @@ -626,7 +628,12 @@ jobs: sudo apt-mark hold firefox grub-efi-amd64-signed sudo apt update sudo apt upgrade - sudo apt install lcov + sudo apt install libcapture-tiny-perl libdatetime-perl libtimedate-perl libjson-perl libperlio-gzip-perl + curl --location --silent \ + "https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz"| + tar --extract --gzip --directory "${RUNNER_TEMP}" + "${RUNNER_TEMP}/lcov-${LCOV_VERSION}/bin/lcov" --version + tee -a "${GITHUB_PATH}" <<< "${RUNNER_TEMP}/lcov-${LCOV_VERSION}/bin" - name: Download test results env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -643,9 +650,10 @@ jobs: # Update source code paths from Windows tracefiles to match Linux, and remove all \r chars from line endings. sed -i -Ee 's|\r$||' -e 's|\\|/|g' -e 's|^SF:D:/a|SF:/home/runner/work|' artifacts/*.win.*/**/coverage.info # Combine all tracefiles into one. + tee -a "$HOME/.lcovrc" <<< 'check_data_consistency = 0' lcov $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info # Generate the HTML report. - echo 'genhtml_sort = 0' >> ~/.lcovrc + tee -a "$HOME/.lcovrc" <<< 'genhtml_sort = 0' genhtml --output-directory coverage/coverage coverage.info # Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu GCC Qt6 job's version will do. /usr/bin/env bash ./artifacts/test-results-*.gcc.qt-6/coverage/removeHtmlDates.sh From 5c65691169fcf809b9a5b485718acb3b5ff8a51b Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Sun, 22 Dec 2024 22:57:53 +1100 Subject: [PATCH 2/2] Replace some `echo`s with `tee` --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index adcba1d96..a7d8d973f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -524,8 +524,8 @@ jobs: if: matrix.arch == 'arm64' shell: bash run: | - echo "CMAKE_TOOLCHAIN_FILE=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" >> $GITHUB_ENV - echo "qtHostPath=${QT_ROOT_DIR/_arm64/_64}" >> $GITHUB_ENV + tee -a "${GITHUB_ENV}" <<< "CMAKE_TOOLCHAIN_FILE=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" + tee -a "${GITHUB_ENV}" <<< "qtHostPath=${QT_ROOT_DIR/_arm64/_64}" - name: Configure MSVC if: matrix.toolchain == 'msvc' uses: ilammy/msvc-dev-cmd@v1 @@ -559,7 +559,7 @@ jobs: id: post-build shell: bash run: | - echo "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")" | tee -a "$GITHUB_OUTPUT" + tee -a "${GITHUB_OUTPUT}" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")" { echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT" - name: Install DLL for tests w/ coverage