Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report test coverage using gcovr #380

Merged
merged 12 commits into from
Mar 3, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
key: nceplibs-${{ runner.os }}-1.3.0

- name: build-nceplibs
if: steps.cache-nceplibs.outputs.cache-hit != 'true'
run: |
set -x
export ESMFMKFILE=~/esmf/lib/esmf.mk
Expand All @@ -125,9 +126,4 @@ jobs:
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper;~/nceplibs' -DENABLE_DOCS=On
make -j2
make test






31 changes: 24 additions & 7 deletions .github/workflows/esmf-8.0.1_jasper-2.0.22_nceplibs-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
sudo ln -sf /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
fi
fi
export PATH="~/.local/bin:$PATH"
python3 -m pip install gcovr

- name: cache-esmf
id: cache-esmf
Expand Down Expand Up @@ -94,13 +96,26 @@ jobs:
repository: NOAA-EMC/NCEPLIBS
path: nceplibs

- name: get-git-hash
run: |
cd nceplibs
git rev-parse HEAD > hash.txt

- name: cache-nceplibs-develop
id: cache-nceplibs-develop
uses: actions/cache@v2
with:
path: ~/nceplibs
key: nceplibs-develop-${{ runner.os }}-${{ hashFiles('nceplibs/hash.txt') }}

- name: build-nceplibs
if: steps.cache-nceplibs-develop.outputs.cache-hit != 'true'
run: |
set -x
export ESMFMKFILE=~/esmf/lib/esmf.mk
cd nceplibs
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper' -DCMAKE_INSTALL_PREFIX='~' -DFLAT=ON
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper' -DCMAKE_INSTALL_PREFIX='~/nceplibs' -DFLAT=ON
make -j2

- name: checkout-ufs-utils
Expand All @@ -113,12 +128,14 @@ jobs:
export ESMFMKFILE=~/esmf/lib/esmf.mk
cd ufs_utils
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper' -DENABLE_DOCS=On
cmake .. -DCMAKE_PREFIX_PATH='~/jasper;~/nceplibs' -DENABLE_DOCS=On -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -O0"
make -j2
make test
export PATH="/home/runner/.local/bin:$PATH"
gcovr -r .. --html -o test-coverage.html





- uses: actions/upload-artifact@v2
if: ${{ matrix.os == 'ubuntu-20.04' }}
with:
name: test-coverage
path: ufs_utils/build/test-coverage.html