Skip to content

Commit

Permalink
Upload code coverage report to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
benvenutti committed Aug 31, 2024
1 parent 1796c65 commit a4c25a0
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,40 @@ jobs:
version: '6.5.*'
target: 'desktop'

- name: Install dependencies
run: sudo apt-get install -o Acquire::Retries=3 lcov

- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure
working-directory: ${{github.workspace}}/build
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON ..

- name: Build
working-directory: ${{github.workspace}}/build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Debug --verbose

- name: Gather baseline coverage
working-directory: ${{runner.workspace}}/build
run: lcov --directory . --capture --initial --output-file baseline.info

- name: Test
working-directory: ${{github.workspace}}/build
working-directory: ${{runner.workspace}}/build
run: ctest -C Debug -VV .

- name: Gather test coverage
working-directory: ${{runner.workspace}}/build
run: lcov --directory . --capture --output-file test.info

- name: Generate coverage report
working-directory: ${{runner.workspace}}/build
run: |
lcov -a baseline.info -a test.info --output-file coverage.info
genhtml --demangle-cpp -o coverage coverage.info
- name: Upload results to Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ${{runner.workspace}}/build/coverage.info
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a4c25a0

Please sign in to comment.