Coverage Report #257
This file contains hidden or 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 Report | |
| on: | |
| workflow_run: | |
| workflows: [Tests] | |
| types: [completed] | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 | |
| with: | |
| python-version: '3.x' | |
| architecture: x64 | |
| - name: Install Dependencies | |
| run: |- | |
| sudo apt install lcov | |
| python -m pip install lcov_cobertura | |
| - name: Run CMake | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage" -DBUILD_TESTING_FULL=ON -DBUILD_CFP=ON -DZFP_WITH_OPENMP=ON | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build | |
| - name: Run Tests | |
| working-directory: ${{github.workspace}}/build | |
| run: ctest -j 8 | |
| - name: Generate Coverage Report | |
| working-directory: ${{github.workspace}}/build | |
| # for now, suppress mismatch errors (likely gcc/gcov bug) | |
| run: |- | |
| lcov -c --directory ${{github.workspace}}/build --output-file coverage.info --ignore-errors mismatch | |
| lcov --remove coverage.info '${{github.workspace}}/build/tests/*' --remove coverage.info '${{github.workspace}}/tests/*' --remove coverage.info '/usr/include/*' -o coverage.info | |
| lcov_cobertura ${{github.workspace}}/build/coverage.info -d -o ${{github.workspace}}/build/coverage.xml | |
| - name: Upload Report to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ${{github.workspace}}/build/coverage.xml | |
| env_vars: Actions | |
| fail_ci_if_error: true |