Skip to content

Remove benchmark from coverage analysis. #5

Remove benchmark from coverage analysis.

Remove benchmark from coverage analysis. #5

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up CMake
run: sudo apt-get install cmake lcov
- name: Configure with CMake
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage -O0" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
- name: Build
run: cmake --build build
- name: Run Tests
run: ctest --test-dir build
- name: Capture Coverage Info
run: |
cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # Remove coverage for system files.
lcov --remove coverage.info 'src/rstats/test/benchmark_rstats.c' --output-file coverage.info # Remove coverage for benchmarkrstats.
lcov --list coverage.info # Optional: Display coverage info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true