Skip to content

Input netCDFs

Input netCDFs #587

Workflow file for this run

name: tests
#TODO: run unit tests with different compiler versions of both gcc and clang
on:
push:
branches: [master, main, release/**]
pull_request:
branches: [master, main, release/**]
jobs:
build_nix:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Print compiler versions as seen by make
run: make compiler_version
- name: Run binary
run: |
make clean bin_run
make clean bin_debug_severe
- name: Run binary (with sanitizers)
# Apple clang does not support "AddressSanitizer: detect_leaks" (at least as of clang-1200.0.32.29)
if: ${{ runner.os != 'macOS' }}
run: make clean bin_sanitizer
- name: Unit tests (shuffle and repeat 3x)
run: make clean test_rep3rnd
- name: Severe unit tests (without sanitizers)
if: ${{ runner.os == 'macOS' }}
run: make clean test_severe
- name: Severe unit tests (with sanitizers)
# Apple clang does not support "AddressSanitizer: detect_leaks" (at least as of clang-1200.0.32.29)
if: ${{ runner.os != 'macOS' }}
run: make clean test_sanitizer
- name: Compile as library for STEPWAT2
run: CPPFLAGS='-DSTEPWAT' make clean lib
- name: Compile as library for rSOILWAT2
# Rmock/ provides bare-bones headers of R C-API functions required by SOILWAT2
run: CPPFLAGS='-DRSOILWAT' CFLAGS='-Iexternal/Rmock' make clean libr
build_ncSW2:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install netCDF-C and udunits2
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libudunits2-dev
- name: Build binary with netCDF and udunits2 support
run: CPPFLAGS=-DSWNC make clean all
check_code_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Generate coverage report
run: CXX=g++ GCOV=gcov make clean clean_cov cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false # just report, don't fail checks
token: ${{ secrets.CODECOV_TOKEN }}