From aad9912443d70051c52609a194e1ccc5b2a0131d Mon Sep 17 00:00:00 2001 From: Edward Hartnett <38856240+edwardhartnett@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:03:54 -0700 Subject: [PATCH] adding developer workflow (#724) * adding developer workflow * working on developer workflow * working on developer workflow * working on developer workflow * more changes * more changes * more changes * more changes * more changes * more * more * addding debug2 * addding debug2 * addding debug2 * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more * more --- .../workflows/debug-docs-test_coverage.yml | 21 +- .github/workflows/developer.yml | 356 ++++++++++++++++++ .github/workflows/intel.yml | 12 +- .github/workflows/linux-mac-nceplibs-mpi.yml | 12 +- .github/workflows/netcdf-versions.yml | 14 +- CMakeLists.txt | 3 +- 6 files changed, 404 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/developer.yml diff --git a/.github/workflows/debug-docs-test_coverage.yml b/.github/workflows/debug-docs-test_coverage.yml index 9df96f5e4..be1371f69 100644 --- a/.github/workflows/debug-docs-test_coverage.yml +++ b/.github/workflows/debug-docs-test_coverage.yml @@ -1,5 +1,15 @@ name: debug-docs-test_coverage -on: [push, pull_request] +on: + push: + branches: + - develop + paths-ignore: + - README.md + pull_request: + branches: + - develop + paths-ignore: + - README.md defaults: run: @@ -105,12 +115,5 @@ jobs: - name: test run: | cd ufs_utils/build - export LSAN_OPTIONS=suppressions=LSanSuppress.supp +# export LSAN_OPTIONS=suppressions=LSanSuppress.supp ctest --rerun-failed --output-on-failure - export PATH="/home/runner/.local/bin:$PATH" - gcovr -r .. --html-details -o test-coverage.html - - - uses: actions/upload-artifact@v2 - with: - name: test-coverage - path: ufs_utils/build/*.html diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml new file mode 100644 index 000000000..4401171f6 --- /dev/null +++ b/.github/workflows/developer.yml @@ -0,0 +1,356 @@ +# UFS_UTILS test workflow. +# +# This workflow tests all developer options - address santizer, +# warning check, documentation check, and test code coverage. +# +# Ed Hartnett 12/11/22 +name: developer +on: + push: + branches: + - develop + paths-ignore: + - README.md + pull_request: + branches: + - develop + paths-ignore: + - README.md + +defaults: + run: + shell: bash -exo pipefail {0} + +jobs: + developer: + runs-on: ubuntu-latest + env: + FC: mpifort + CC: mpicc + FCFLAGS: -fallow-argument-mismatch + + steps: + + - name: install-dependencies + run: | + sudo apt-get update + sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev doxygen libmpich-dev + sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config + python3 -m pip install gcovr + + - name: cache-esmf + id: cache-esmf + uses: actions/cache@v2 + with: + path: ~/esmf + key: developer-esmf-8.2.0-${{ runner.os }}3 + + - name: build-esmf + if: steps.cache-esmf.outputs.cache-hit != 'true' + run: | + pushd ~ + export ESMF_DIR=~/esmf-ESMF_8_2_0 + wget https://github.com/esmf-org/esmf/archive/ESMF_8_2_0.tar.gz &> /dev/null + tar zxf ESMF_8_2_0.tar.gz + cd esmf-ESMF_8_2_0 + export ESMF_COMM=mpich3 + export ESMF_INSTALL_BINDIR=bin + export ESMF_INSTALL_LIBDIR=lib + export ESMF_INSTALL_MODDIR=mod + export ESMF_COMPILER=gfortran + export ESMF_INSTALL_PREFIX=~/esmf + export ESMF_NETCDF=split + export ESMF_NETCDF_INCLUDE=/usr/include + export ESMF_NETCDF_LIBPATH=/usr/x86_64-linux-gnu + make -j2 + make install + + - name: cache-jasper + id: cache-jasper + uses: actions/cache@v2 + with: + path: ~/jasper + key: developer-jasper-${{ runner.os }}-2.0.33-1 + + - name: checkout-jasper + if: steps.cache-jasper.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: jasper-software/jasper + path: jasper + ref: version-2.0.33 + + - name: build-jasper + if: steps.cache-jasper.outputs.cache-hit != 'true' + run: | + cd jasper + mkdir build-jasper && cd build-jasper + cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper + make -j2 + make install + + - name: cache-bacio + id: cache-bacio + uses: actions/cache@v2 + with: + path: ~/bacio + key: developer-bacio-${{ runner.os }}-v2.4.1 + + - name: checkout-bacio + if: steps.cache-bacio.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-bacio + path: bacio + ref: v2.4.1 + + - name: build-bacio + if: steps.cache-bacio.outputs.cache-hit != 'true' + run: | + cd bacio + mkdir build && cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/bacio + make -j2 + make install + + - name: cache-g2 + id: cache-g2 + uses: actions/cache@v2 + with: + path: ~/g2 + key: developer-g2-${{ runner.os }}-3.4.3 + + - name: checkout-g2 + if: steps.cache-g2.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-g2 + path: g2 + ref: v3.4.3 + + - name: build-g2 + if: steps.cache-g2.outputs.cache-hit != 'true' + run: | + cd g2 + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=~/g2 -DCMAKE_PREFIX_PATH="~/bacio;~/jasper" .. + make -j2 + make install + + - name: cache-sp + id: cache-sp + uses: actions/cache@v2 + with: + path: ~/sp + key: developer-sp-${{ runner.os }}-2.3.3-1 + + - name: checkout-sp + if: steps.cache-sp.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-sp + path: sp + ref: v2.3.3 + + - name: build-sp + if: steps.cache-sp.outputs.cache-hit != 'true' + run: | + cd sp + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/sp + make -j2 + make install + + - name: cache-ip + id: cache-ip + uses: actions/cache@v2 + with: + path: ~/ip + key: developer-ip-${{ runner.os }}-3.3.3 + + - name: checkout-ip + if: steps.cache-ip.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-ip + path: ip + ref: v3.3.3 + + - name: build-ip + if: steps.cache-ip.outputs.cache-hit != 'true' + run: | + cd ip + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=~/ip -DCMAKE_PREFIX_PATH=~~/sp .. + make -j2 + make install + + # - name: checkout-w3emc + # uses: actions/checkout@v2 + # with: + # repository: NOAA-EMC/NCEPLIBS-w3emc + # path: w3emc + # ref: develop + + # - name: build-w3emc + # run: | + # cd w3emc + # mkdir build + # cd build + # cmake -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc .. + # make -j2 + # make install + + # - name: checkout-g2c + # uses: actions/checkout@v2 + # with: + # repository: NOAA-EMC/NCEPLIBS-g2c + # path: g2c + # ref: develop + + # - name: build-g2c + # run: | + # cd g2c + # mkdir build + # cd build + # cmake .. -DCMAKE_INSTALL_PREFIX=~/g2c -DJasper_ROOT=~/jasper + # make -j2 + # make install + + - name: cache-sfcio + id: cache-sfcio + uses: actions/cache@v2 + with: + path: ~/sfcio + key: developer-sfcio-${{ runner.os }}-1.4.0-1 + + - name: checkout-sfcio + if: steps.cache-sfcio.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-sfcio + path: sfcio + ref: v1.4.0 + + - name: build-sfcio + if: steps.cache-sfcio.outputs.cache-hit != 'true' + run: | + cd sfcio + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/sfcio + make -j2 + make install + + - name: cache-w3nco + id: cache-w3nco + uses: actions/cache@v2 + with: + path: ~/w3nco + key: developer-w3nco-${{ runner.os }}-2.4.0 + + - name: checkout-w3nco + if: steps.cache-w3nco.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-w3nco + path: w3nco + ref: v2.4.0 + + - name: build-w3nco + if: steps.cache-w3nco.outputs.cache-hit != 'true' + run: | + cd w3nco + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco + make -j2 + make install + + - name: cache-nemsio + id: cache-nemsio + uses: actions/cache@v2 + with: + path: ~/nemsio + key: developer-nemsio-${{ runner.os }}-2.5.0-1 + + - name: checkout-nemsio + if: steps.cache-nemsio.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-nemsio + path: nemsio + ref: v2.5.0 + + - name: build-nemsio + if: steps.cache-nemsio.outputs.cache-hit != 'true' + run: | + cd nemsio + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=~/nemsio -DCMAKE_PREFIX_PATH="~/bacio;~/w3nco" .. + make -j2 + make install + + - name: cache-sigio + id: cache-sigio + uses: actions/cache@v2 + with: + path: ~/sigio + key: developer-sigio-${{ runner.os }}-2.3.0 + + - name: checkout-sigio + if: steps.cache-sigio.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-sigio + path: sigio + ref: v2.3.0 + + - name: build-sigio + if: steps.cache-sigio.outputs.cache-hit != 'true' + run: | + cd sigio + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/sigio + make -j2 + make install + + - name: checkout + uses: actions/checkout@v2 + with: + path: ufs_utils + submodules: true + + - name: build + run: | + set -x + cd ufs_utils + mkdir build + doxygen --version + export ESMFMKFILE=~/esmf/lib/esmf.mk + cd build + cmake .. -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DENABLE_DOCS=On -DJasper_ROOT=~/jasper -DCMAKE_PREFIX_PATH="~/g2c;~/bacio;~/g2;~/w3nco;~/sfcio;~/sigio;~/nemsio;~/sp;~/ip" -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -O0" -DCMAKE_BUILD_TYPE=Debug + make -j2 VERBOSE=1 + + - name: test + run: | + cd ufs_utils/build + ctest --verbose --rerun-failed --output-on-failure + 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@v2 + with: + name: ufs_utils-test-coverage + path: | + ufs_utils/build/*.html + ufs_utils/build/*.css + + + + diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 0e9b88164..200a91f03 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -1,5 +1,15 @@ name: intel -on: [push, pull_request] +on: + push: + branches: + - develop + paths-ignore: + - README.md + pull_request: + branches: + - develop + paths-ignore: + - README.md # Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh # without having to do it in manually every step diff --git a/.github/workflows/linux-mac-nceplibs-mpi.yml b/.github/workflows/linux-mac-nceplibs-mpi.yml index 82d35a9d2..8b7aab007 100644 --- a/.github/workflows/linux-mac-nceplibs-mpi.yml +++ b/.github/workflows/linux-mac-nceplibs-mpi.yml @@ -1,5 +1,15 @@ name: linux-mac-mpi-nceplibs -on: [push, pull_request] +on: + push: + branches: + - develop + paths-ignore: + - README.md + pull_request: + branches: + - develop + paths-ignore: + - README.md defaults: run: diff --git a/.github/workflows/netcdf-versions.yml b/.github/workflows/netcdf-versions.yml index 38940ff10..424bff3ca 100644 --- a/.github/workflows/netcdf-versions.yml +++ b/.github/workflows/netcdf-versions.yml @@ -1,5 +1,15 @@ name: netcdf-versions -on: [push, pull_request] +on: + push: + branches: + - develop + paths-ignore: + - README.md + pull_request: + branches: + - develop + paths-ignore: + - README.md defaults: run: @@ -156,5 +166,5 @@ jobs: - name: test run: | cd ufs_utils/build - export LSAN_OPTIONS=suppressions=LSanSuppress.supp +# export LSAN_OPTIONS=suppressions=LSanSuppress.supp ctest --rerun-failed --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index ef9da1dde..76e92900e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,8 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz") endif() set(CMAKE_Fortran_FLAGS_RELEASE "-O3") - set(CMAKE_Fortran_FLAGS_DEBUG "-O1 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") +# set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall") + set(CMAKE_Fortran_FLAGS_DEBUG "-O1 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fno-omit-frame-pointer -fno-optimize-sibling-calls") endif() if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")