Skip to content

sync: cherry-pick for release/0.23.x #2793

sync: cherry-pick for release/0.23.x

sync: cherry-pick for release/0.23.x #2793

name: Test Coverage CI
on:
pull_request:
push:
branches:
- master
# Checks if any concurrent jobs under the same pull request or branch are being executed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
unit-test-libsinsp-coverage:
name: unit-test-libsinsp-coverage 🧐
runs-on: 'ubuntu-24.04'
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Install deps ⛓️
run: |
sudo apt-get update && sudo apt install -y --no-install-recommends ca-certificates build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libre2-dev libtbb-dev libjq-dev libjsoncpp-dev protobuf-compiler libgtest-dev libprotobuf-dev linux-headers-$(uname -r) gpg gpg-agent gcovr
sudo .github/install-deps.sh
- name: Install cmake 🌊
uses: ./.github/actions/install-cmake
- name: Build and test 🏗️🧪
run: |
cmake -B build -S . -DBUILD_WARNINGS_AS_ERRORS=True -DENABLE_COVERAGE=True -DUSE_BUNDLED_DEPS=False
KERNELDIR=/lib/modules/$(ls /lib/modules)/build cmake --build build --parallel $(nproc)
cmake --build build --target run-unit-tests --parallel $(nproc)
- name: Generate libsinsp coverage report
run: |
# Exclude gVisor protobuf-generated headers since they generated unrecognizable blocks for gcovr.
gcovr --gcov-ignore-parse-errors=all --exclude 'gvisor/pkg/sentry/seccheck/points/.*' --xml -o ./libsinsp.coverage.xml
- name: Upload to codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
files: ./libsinsp.coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: libsinsp