Skip to content

Create code-coverage.yml #1

Create code-coverage.yml

Create code-coverage.yml #1

Workflow file for this run

# This workflow will install dependencies, build the project, run tests with code coverage and upload the results to Codecov
name: Code Coverage
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cmake and gtest
run: |
sudo apt-get install -y cmake lcov libgtest-dev
- name: Build project
run: |
cmake .
make
- name: Run tests
run: |
bin/ut_factory_injector
- name: Run code coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/tests/*' "${HOME}"'/.cache/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.info