Skip to content

Commit

Permalink
Add Github action for Code-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhashiniNaik committed Nov 5, 2024
1 parent b12af2b commit 28fa011
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,34 @@ env:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.22.x'
- name: Configure CMake
run: cmake -B cmake-build-posix -S executables/referenceApp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build cmake-build-posix --target app.referenceApp -j --config ${{env.BUILD_TYPE}}

- name: Test
# Execute tests defined by the CMake configuration.
run: |
cmake -B cmake-build-unit-tests -S executables/unitTest -DBUILD_UNIT_TESTS=ON
cmake --build cmake-build-unit-tests -j4
ctest --test-dir cmake-build-unit-tests -j4
#Code coverage
- name: Install lcov
run: sudo apt install lcov

- name: Capture code coverage
run: lcov --capture --directory . \

- name: Capture code coverage 2
run: --output-file cmake-build-unit-tests/coverage_unfiltered.info
run: lcov --capture --directory . --output-file cmake-build-unit-tests/coverage_unfiltered.info

- name: Filter out 3rd party and mock files
run: |
Expand Down

0 comments on commit 28fa011

Please sign in to comment.