Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,39 @@ jobs:
run: cargo +${{ matrix.rust-version }} test


coverage:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Comment thread
Molter73 marked this conversation as resolved.
with:
submodules: true
Comment thread
Molter73 marked this conversation as resolved.

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libbpf-dev \
protobuf-compiler

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}

- name: Generate coverage
run: make coverage

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
Comment thread
Molter73 marked this conversation as resolved.

format-check:
runs-on: ubuntu-24.04
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internalapi/
results.xml
logs/
THIRD_PARTY_LICENSES.html
codecov.json

# clangd and compilation database
.cache/
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ possible include a PR number for easier tracking.

## Next

* feat: add code coverage with cargo-llvm-cov and Codecov upload (#745)

## 0.3.0

* ROX-34663: Migrate from ubi-minimal to ubi-micro (#653)
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ integration-tests:
performance-tests:
make -C performance-tests

coverage:
cargo llvm-cov --workspace --codecov --output-path codecov.json

clean:
make -C tests clean
rm -f THIRD_PARTY_LICENSES.html
rm -f codecov.json

format-check:
cargo fmt --check
Expand All @@ -44,4 +48,4 @@ format:
cargo fmt
make -C fact-ebpf format

.PHONY: tag mock-server integration-tests image image-name licenses clean
.PHONY: tag mock-server integration-tests image image-name licenses coverage clean
Loading