Skip to content

eBPF-based security platform

ci: publish x86-64 host coverage on every CI run

Mahe Tardy9f74e4f2dbeb
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index ffce970a..e6dad3b1 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -59,11 +59,14 @@ jobs:
- name: CI tests
runner: ubuntu-latest
vm: '1'
+ coverage: '1'
- name: CI host tests (arm64)
runner: ubuntu-24.04-arm
vm: '0'
+ coverage: '0'
env:
VM: ${{ matrix.vm }}
+ COVERAGE: ${{ matrix.coverage }}
steps:
- name: Require successful kernel preparation
@@ -160,6 +163,17 @@ jobs:
if: ${{ !cancelled() && steps.setup.outcome == 'success' && matrix.vm == '1' }}
run: .github/scripts/tests.sh run end2end
+ - name: Collect host userspace coverage
+ if: env.COVERAGE == '1'
+ run: .github/scripts/coverage.sh
+
+ - name: Upload coverage to Coveralls
+ if: env.COVERAGE == '1'
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
+ with:
+ file: coverage/host.lcov
+ format: lcov
+
- name: Upload end-to-end guest logs
if: always() && steps.end2end.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rst
index d388e0f9..5db38d6d 100644
--- a/Documentation/contribute/testing/testing.rst
+++ b/Documentation/contribute/testing/testing.rst
@@ -77,6 +77,15 @@ Land kernel input changes first. After publishing their bundles, update
the pin in the same change as any shirudo code that requires the new
kernel.
+Host userspace coverage
+-----------------------
+
+On every run of the ``CI suite``, the x86-64 job builds its host userspace C
+binaries with coverage instrumentation. It sends an LCOV report to Coveralls
+after the existing test steps pass. The ``main`` reports provide a baseline for
+pull request coverage comparisons. Reports exclude test code, vendored code,
+QEMU guests and BPF programs.
+
Check the quickstart and quick guides
-------------------------------------