Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(linux): small coverage fixes #1188

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 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 gpg gpgv gpg-agent 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,14 +95,22 @@ 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
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl --silent --remote-name https://uploader.codecov.io/latest/linux/codecov
curl --silent --remote-name https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl --silent --remote-name https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
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 \
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM \
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
sqop verify codecov.SHA256SUM.sig pgp_keys.asc < codecov.SHA256SUM
sha256sum --check codecov.SHA256SUM
chmod +x codecov
./codecov
Loading