From ded3284261e8f57f41af187839aae95efcff7680 Mon Sep 17 00:00:00 2001 From: Nels Frazier Date: Fri, 18 Mar 2022 20:24:32 +0000 Subject: [PATCH] add workflow test for t-route integration test --- .github/workflows/module_integration.yml | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/.github/workflows/module_integration.yml b/.github/workflows/module_integration.yml index c69a234349..7c441b3149 100644 --- a/.github/workflows/module_integration.yml +++ b/.github/workflows/module_integration.yml @@ -68,3 +68,71 @@ jobs: - name: Run surfacebmi plus cfebmi run: ./cmake_build/ngen data/catchment_data.geojson "cat-27" data/nexus_data.geojson "nex-26" data/example_bmi_multi_realization_config.json + +# Run t-route/pybind integration test + test_troute_integration: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Init Submodules + run: git submodule update --init --recursive + + - name: Cache Boost Dependency + id: cache-boost-dep + uses: actions/cache@v1 + with: + path: boost_1_72_0 + key: unix-boost-dep + + - name: Get Boost Dependency + if: steps.cache-boost-dep.outputs.cache-hit != 'true' + run: | + curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 + tar xjf boost_1_72_0.tar.bz2 + + - name: Get netcdff library + run: | + sudo apt-get install -y libnetcdf-dev libnetcdff-dev + + - name: Cache troute dependency + id: cache-linux-troute-dep + uses: actions/cache@v1 + with: + path: .venv + key: linux-troute-dep + + - name: Build T-route Dependency + if: steps.cache-linux-troute-dep.outputs.cache-hit != 'true' + run: | + python -m venv .venv + . .venv/bin/activate + cd extern/t-route + pip install pip + pip install -r requirements.txt + cd src + pip install -e nwm_routing + pip install -e ngen_routing + cd python_routing_v02 + FC=gfortran ./compiler.sh + deactivate + + - name: cmake_init_build + run: | + export BOOST_ROOT="$(pwd)/boost_1_72_0" + [ ! -d "$BOOST_ROOT" ] && echo "Error: no Boost root found at $BOOST_ROOT" && exit 1 + cmake -B cmake_build -DNGEN_ACTIVATE_ROUTING:BOOL=on -S . + + - name: Build test + run: cmake --build cmake_build --target test_routing_pybind -- -j ${{ env.LINUX_NUM_PROC_CORES }} + timeout-minutes: 15 + + - name: Run test + run: | + . .venv/bin/activate + ./cmake_build/test/test_routing_pybind + deactivate