Skip to content

Commit

Permalink
ci(linux): drop lcov usage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tachi107 committed Jan 13, 2024
1 parent da7dd46 commit 1866abc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 \
Expand All @@ -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

0 comments on commit 1866abc

Please sign in to comment.