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 86bcf34
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 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 @@ -95,9 +95,16 @@ jobs:
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
echo '#!/bin/sh' > $HOME/.local/bin/cov.sh
if [ "${{ matrix.compiler }}" = 'clang' ]
then
echo 'llvm-cov gcov "$@"' >> $HOME/.local/bin/cov.sh
else
echo 'gcov "$@"' >> $HOME/.local/bin/cov.sh
fi
chmod +x $HOME/.local/bin/cov.sh
cd build
find .. -name '*.gcda' -o -name '*.gcno' | grep -v tests | xargs $HOME/.local/bin/cov.sh --branch-probabilities --preserve-paths --relative-only
curl --remote-name-all \
https://keybase.io/codecovsecurity/pgp_keys.asc \
https://uploader.codecov.io/latest/linux/codecov \
Expand Down

0 comments on commit 86bcf34

Please sign in to comment.