diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7afc7dba0..5e8c668cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -242,7 +242,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 \ @@ -525,8 +525,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 @@ -560,7 +560,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 @@ -649,6 +649,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 @@ -656,7 +658,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 }} @@ -673,9 +680,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