generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 63
133 lines (118 loc) · 4.61 KB
/
module_integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Module Integration Tests
# Controls when the action will run.
on:
push:
branches: [ master, dev, notreal ]
pull_request:
branches: [ master, dev, notreal ]
workflow_dispatch:
env:
# Obtained from https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# TODO: add something later that can check the runners for hyperthreading
LINUX_NUM_PROC_CORES: 2
MACOS_NUM_PROC_CORES: 3
ASAN_OPTIONS: detect_leaks=false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Run general unit tests in linux environment
test_surfacebmi_plus_cfe:
# The type of runner that the job will run on
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
fail-fast: false
runs-on: ${{ matrix.os }}
# 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@v3
- name: Build NGen
uses: ./.github/actions/ngen-build
with:
targets: "ngen"
build-cores: ${{ env.LINUX_NUM_PROC_CORES }}
bmi_c: 'ON'
bmi_fortran: 'ON'
timeout-minutes: 15
- name: Run surfacebmi plus cfebmi
run: |
inputfile='data/example_bmi_multi_realization_config.json'
./cmake_build/ngen || true
./cmake_build/ngen data/catchment_data.geojson "cat-27" data/nexus_data.geojson "nex-26" $inputfile
- name: Run surfacebmi, cfebmi and petbmi
run: |
inputfile='data/example_bmi_multi_realization_config_w_noah_pet_cfe.json'
./cmake_build/ngen || true
./cmake_build/ngen data/catchment_data.geojson "cat-27" data/nexus_data.geojson "nex-26" $inputfile
# Run t-route/pybind integration test
test_troute_integration:
# The type of runner that the job will run on
strategy:
matrix:
os: [ubuntu-22.04] # [ubuntu-latest, macos-12] #TODO: Fix #505
fail-fast: false
runs-on: ${{ matrix.os }}
# 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@v3
- name: Build Ngen
uses: ./.github/actions/ngen-build
with:
targets: "test_routing_pybind"
build-cores: ${{ env.LINUX_NUM_PROC_CORES }}
#is this required for this test?
use_python: 'ON'
use_troute: 'ON'
timeout-minutes: 15
# Disabling this cache for the time being for a few reasons
# 1) t-route build/install can be tricky without pre-cythonized sources
# 2) may not want to use a cached version of t-route if we are testing its integration
# we want to use the latest code in the repo and make sure it works...a cached version
# wouldn't be good for that...
#- name: Cache troute dependency
# id: cache-linux-troute-dep
# uses: actions/cache@v1
# with:
# path: .venv
# key: linux-troute-dep-fixed
- name: Checkout t-route (latest master)
uses: actions/checkout@v3
with:
repository: NOAA-OWP/t-route
path: t-route
#This step should come after ngen build???
- name: Configure Fortran Compiler
run: |
if [ ${{ runner.os }} == 'macOS' ]
then
sudo ln -s $(which gfortran-11) $(dirname $(which gfortran-11))/gfortran
export FC=gfortran-11
export F90=gfortran-11
fi
- name: Build T-route Dependency
#if: steps.cache-linux-troute-dep.outputs.cache-hit != 'true'
#MacOS pybind has issues with egg links, so install all packages without egg links on that os
run: |
python3 -m venv .venv
. .venv/bin/activate
cd t-route
pip install 'pip>=23.0,<23.1'
pip install -U setuptools
pip install -r requirements.txt
pip install deprecated 'pyarrow==11.0.0' tables geopandas numpy
if [ ${{ runner.os }} == 'macOS' ]
then
export LIBRARY_PATH=/usr/local/lib/gcc/11/
export LD_LIBRARY_PATH=/usr/local/lib/gcc/11/
fi
export NETCDFALTERNATIVE=${NETCDF}/include
export FC=gfortran
export F90=gfortran
./compiler.sh no-e
deactivate
- name: Run test
run: |
. .venv/bin/activate
./cmake_build/test/test_routing_pybind
deactivate