Skip to content

Cfe Version 3 Migration #238

Cfe Version 3 Migration

Cfe Version 3 Migration #238

# Test ngen-cfe integration
name: Ngen Integration Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
LINUX_NUM_PROC_CORES: 2
MACOS_NUM_PROC_CORES: 3
ASAN_OPTIONS: detect_leaks=false
jobs:
test_cfe:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout CFE
uses: actions/checkout@v4
- name: Build CFE Library
run: |
cmake -B cmake_build -S . -DCMAKE_C_FLAGS='-g -Og -fsanitize=address -Werror'
make -C cmake_build
- name: Checkout and build PET
run: |
git clone https://github.com/NOAA-OWP/evapotranspiration.git pet_src
cmake -B pet_src/cmake_build -S pet_src -DCMAKE_C_FLAGS='-g -Og -fsanitize=address'
make -C pet_src/cmake_build petbmi
- name: Save CFE and PET to temp directory
run: |
mkdir ${{ runner.temp }}/cfe
cp -r ./* ${{ runner.temp }}/cfe
mkdir ${{ runner.temp }}/pet
cp -r pet_src/* ${{ runner.temp }}/pet
- name: Checkout ngen
uses: actions/checkout@v4
with:
repository: noaa-owp/ngen
- name: Build SLoTH
id: submod_build_sloth
uses: ./.github/actions/ngen-submod-build
with:
cmake-flags: -DCMAKE_POLICY_VERSION_MINIMUM=3.5
mod-dir: "extern/sloth/"
targets: "slothmodel"
- name: Build Ngen
id: ngen_id1
uses: ./.github/actions/ngen-build
with:
targets: "ngen"
build-cores: ${{ env.LINUX_NUM_PROC_CORES }}
bmi_c: 'ON'
build_extern: 'OFF'
timeout-minutes: 15
- name: Install CFE and PET into ngen extern
run: |
rm -rf extern/cfe/cfe/*
mv ${{ runner.temp }}/cfe/* extern/cfe/cfe
rm -rf extern/evapotranspiration/evapotranspiration/*
mv ${{ runner.temp }}/pet/* extern/evapotranspiration/evapotranspiration
- name: Run ngen with CFE coupled with PET
run: |
mv ${{ steps.ngen_id1.outputs.build-dir }} ./ngen-build/
inputfile='extern/cfe/cfe/realizations/realization_cfe_pet.json'
./ngen-build/ngen ./data/catchment_data.geojson "cat-27" ./data/nexus_data.geojson "nex-26" $inputfile