| name: Code Coverage |
| |
| on: [pull_request] |
| |
| env: |
| BUILD_TYPE: Debug |
| |
| jobs: |
| build: |
| name: Coveralls |
| runs-on: ubuntu-latest |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| submodules: true |
| - name: Download and install lcov |
| run: | |
| VERSION="1.14" |
| mkdir lcov_pkg && cd lcov_pkg |
| wget "https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-$VERSION.tar.gz" |
| tar -xzf "lcov-$VERSION.tar.gz" |
| cd "lcov-$VERSION" |
| sudo make install |
| - name: Configure |
| run: cd build && cmake .. -DCOVERAGE=ON |
| - name: Build unit tests |
| run: cmake --build build |
| - name: Run tests |
| run: cmake --build build --target test |
| - name: Generate coverage .info |
| run: cmake --build build --target coverage_report |
| - name: Post to Coveralls |
| uses: coverallsapp/github-action@master |
| with: |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| path-to-lcov: build/lcov.info |