Restrict coverage to src directory. #8
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: code-coverage | |
on: | |
push: | |
branch: unit-testing | |
workflow_dispatch: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
gcc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout history | |
uses: actions/checkout@v4 | |
- name: Build pFUnit | |
run: | | |
git clone --depth 1 --branch v4.10.0 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git | |
cd pFUnit | |
cmake -B./build -S. | |
cd build | |
make install | |
- name: Build history | |
run: | | |
cmake \ | |
-DCMAKE_PREFIX_PATH=/home/runner/work/history_output/history_output/pFUnit/build/installed \ | |
-DHISTORY_ENABLE_CODE_COVERAGE=ON \ | |
-B./build \ | |
-S. | |
cd build | |
make | |
- name: Run tests | |
run: | | |
cd build && ctest | |
- name: Setup GCov | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
pip3 install gcovr | |
- name: Run Gcov | |
run: | | |
source venv/bin/activate | |
cd build | |
gcovr -r .. --filter '\.\./src' |