Add unit testing #237
Workflow file for this run
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
# This is a CI workflow for the NCEPLIBS-w3emc project. | |
# | |
# This workflow builds with all developer options, including address | |
# sanitizer and code coverage. | |
# | |
# Ed Hartnett, 1/8/23 | |
name: developer | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
developer: | |
runs-on: ubuntu-latest | |
env: | |
FC: gfortran-11 | |
CC: gcc-11 | |
steps: | |
- name: install-dependencies | |
run: | | |
sudo apt-get install doxygen | |
python3 -m pip install gcovr | |
- name: "Build dependencies" | |
uses: NOAA-EMC/ci-build-nceplibs@develop | |
with: | |
bacio-version: develop | |
bufr-version: bufr_v11.7.1 | |
- name: checkout-w3emc | |
uses: actions/checkout@v4 | |
with: | |
path: w3emc | |
- name: build-w3emc | |
run: | | |
set -x | |
doxygen --version | |
cmake -S w3emc -B w3emc/build -DCMAKE_INSTALL_PREFIX="~/w1" -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bufr" -DENABLE_DOCS=ON -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall" -DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall" -DCMAKE_BUILD_TYPE=Debug -DBUILD_8=ON | |
cmake --build w3emc/build --parallel 2 | |
- name: test-w3emc | |
run: | | |
ctest --test-dir w3emc/build --output-on-failure --rerun-failed --verbose | |
cmake --install w3emc/build | |
ls -l ~/w1 | |
ls -l ~/w1/lib | |
- name: generate-test-coverage | |
run: gcovr --root w3emc -v --html-details --exclude w3emc/tests --exclude w3emc/build/CMakeFiles --print-summary -o test-coverage.html &> /dev/null | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: w3emc-test-coverage | |
path: | | |
*.html | |
*.css | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: | | |
w3emc/build/docs/html |