Skip to content

[cmake] update for coverage test #3

[cmake] update for coverage test

[cmake] update for coverage test #3

Workflow file for this run

name: C++ CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.25'
- name: Install dependencies
run: sudo apt-get install -y lcov
- name: Build
run: |
mkdir -p build
cd build
cmake ..
cmake --build .
- name: Run tests
run: |
cd build
ctest --output-on-failure
- name: Capture coverage
run: |
cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/build/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: build/coverage.info