Upload coverage reports to coveralls #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coverage | |
on: [push] | |
jobs: | |
coverage: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '6.5.*' | |
target: 'desktop' | |
- name: Install coverage-related dependencies | |
run: sudo apt-get install -o Acquire::Retries=3 lcov | |
- name: Create build directory | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure | |
working-directory: ${{runner.workspace}}/build | |
run: cmake $GITHUB_WORKSPACE \ | |
-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DCODE_COVERAGE=ON | |
- name: Build | |
working-directory: ${{runner.workspace}}/build | |
run: cmake --build . --config Debug | |
- name: Gather baseline coverage | |
working-directory: ${{runner.workspace}}/build | |
run: lcov --directory . --capture --initial --output-file baseline.info | |
- name: Test | |
working-directory: ${{runner.workspace}}/build | |
run: ctest --build-config Debug --extra-verbose . | |
- 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 }} |