From 1866abc89ff014e151e2c90ef1810e2b7618a11f Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Sat, 13 Jan 2024 16:38:41 +0100 Subject: [PATCH] ci(linux): drop lcov usage I haven't been able to make lcov 2.0 work for us, so let's just drop it and directly use gcov instead, since codecov supports it as well. --- .github/workflows/linux.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 4dc0c7ed5..9f00290c5 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -57,7 +57,7 @@ jobs: run: | if [ ${{ matrix.compiler }} = gcc ]; then compiler=g++; else compiler="clang lld ?exact-name(libclang-rt-dev)"; fi apt -y update - apt -y install $compiler meson pkg-config cmake rapidjson-dev libssl-dev netbase '?exact-name(libhowardhinnant-date-dev)' '?exact-name(libgmock-dev) (?version([1-9]\.[1-9][1-9]) | ?version([1-9]\.[2-9][0-9]))' '?exact-name(libcpp-httplib-dev)' libcurl4-openssl-dev git ca-certificates curl sqop lcov llvm-dev --no-install-recommends + apt -y install $compiler meson pkg-config cmake rapidjson-dev libssl-dev netbase '?exact-name(libhowardhinnant-date-dev)' '?exact-name(libgmock-dev) (?version([1-9]\.[1-9][1-9]) | ?version([1-9]\.[2-9][0-9]))' '?exact-name(libcpp-httplib-dev)' libcurl4-openssl-dev git ca-certificates curl sqop llvm-dev --no-install-recommends - name: Install dependencies (Red Hat) if: contains(matrix.os, 'redhat') @@ -94,10 +94,17 @@ jobs: - name: Coverage if: ${{ !contains(matrix.os, 'redhat') }} run: | - mkdir -p $HOME/.local/bin - if [ "${{ matrix.compiler }}" = 'clang' ]; then printf 'llvm-cov gcov "$@"' > $HOME/.local/bin/cov.sh; else printf 'gcov "$@"' > $HOME/.local/bin/cov.sh; fi && chmod +x $HOME/.local/bin/cov.sh - lcov --capture --output-file coverage.info --directory . --gcov-tool $HOME/.local/bin/cov.sh --exclude '/usr/*' --exclude "${HOME}"'/.cache/*' --exclude '*/tests/*' --exclude '*/subprojects/*' - lcov --list coverage.info + mkdir -p "$HOME/.local/bin" + if [ "${{ matrix.compiler }}" = 'clang' ] + then + printf '#!/bin/sh\nllvm-cov gcov "$@"\n' > $HOME/.local/bin/cov.sh + else + printf '#!/bin/sh\ngcov "$@"\n' > $HOME/.local/bin/cov.sh + fi + chmod +x $HOME/.local/bin/cov.sh + export PATH="$HOME/.local/bin:$PATH" + cd build + find .. -name '*.gcda' -o -name '*.gcno' | xargs cov.sh --branch-probabilities --function-summaries --preserve-paths --relative-only curl --remote-name-all \ https://keybase.io/codecovsecurity/pgp_keys.asc \ https://uploader.codecov.io/latest/linux/codecov \ @@ -106,4 +113,4 @@ jobs: sqop verify codecov.SHA256SUM.sig pgp_keys.asc < codecov.SHA256SUM sha256sum --check codecov.SHA256SUM chmod +x codecov - ./codecov + ./codecov --gcov --gcovExecutable cov.sh