Repository navigation
48 lines (41 loc) · 1.75 KB
/
Copy pathtest_coverage_ci.yml
File metadata and controls
48 lines (41 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.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 libgtest-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: |
gcovr --gcov-ignore-parse-errors=all --xml -o ./libsinsp.coverage.xml
- name: Upload to codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
fail_ci_if_error: true
files: ./libsinsp.coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: libsinsp