Skip to content

Commit

Permalink
now generate test code coverage report in developer workflow (#104)
Browse files Browse the repository at this point in the history
* turning on code coverage

* turning on code coverage

* updated workflow
  • Loading branch information
edwardhartnett authored Mar 29, 2024
1 parent 1215707 commit 55312de
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
branches:
- develop

# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
developer:
runs-on: ubuntu-latest
Expand All @@ -23,10 +28,10 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config
sudo apt-get install libpng-dev autotools-dev autoconf
sudo apt-get install libpng-dev autotools-dev autoconf gcovr
- name: checkout-jasper
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: jasper-software/jasper
path: jasper
Expand All @@ -41,7 +46,7 @@ jobs:
make install
- name: checkout-sp
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: NOAA-EMC/NCEPLIBS-sp
path: sp
Expand All @@ -57,7 +62,7 @@ jobs:
make install
- name: checkout-ip2
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: NOAA-EMC/NCEPLIBS-ip2
path: ip2
Expand All @@ -73,15 +78,27 @@ jobs:
make install
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: wgrib2

- name: build
run: |
cd wgrib2
mkdir b
cd b
mkdir build
cd build
export CFLAGS='-Wall -g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0'
export FCFLAGS='-Wall -g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0'
export FFLAGS='-Wall -g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0'
cmake ..
make VERBOSE=1
make test
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
- name: upload-test-coverage
uses: actions/upload-artifact@v4
with:
name: wgrib2-test-coverage
path: |
wgrib2/build/*.html
wgrib2/build/*.css

0 comments on commit 55312de

Please sign in to comment.