generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 4
140 lines (118 loc) · 4.66 KB
/
ngen_integration.yaml
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
134
135
136
137
138
139
140
# Test ngen-lgar-c integration
name: Ngen 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_lgar-c:
# The type of runner that the job will run on
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout and build the LGAR-C
- name: Checkout the commit
uses: actions/checkout@v4
- name: Build the LGAR-C Library
run: |
cmake -B cmake_build -S . -DNGEN=ON
make -C cmake_build
- name: Save LGAR-C to a Temp Directory
run: |
# Move files to a temporary directory
mkdir ${{runner.temp}}/lgar
mv ./* ${{runner.temp}}/lgar
# Checkout and build the SoilMoistureProfiles
- name: Checkout the commit
uses: actions/checkout@v4
with:
repository: noaa-owp/soilmoistureprofiles
- name: Build the SMP Library
run: |
cmake -B cmake_build -S . -DNGEN=ON
make -C cmake_build
- name: Save SoilMoistureProfile to a Temp Directory
run: |
# Move files to a temporary directory
mkdir ${{runner.temp}}/smp
mv ./* ${{runner.temp}}/smp
# Checkout and build SoilFreezeThaw
- name: checkout actions in another repo
uses: actions/checkout@v4
with:
repository: noaa-owp/soilfreezethaw
- name: Build the SFT Library
run: |
cmake -B cmake_build -S . -DNGEN=ON
make -C cmake_build
- name: Save SoilFreezeThaw to a Temp Directory
run: |
# Move files to a temporary directory
mkdir ${{runner.temp}}/sft
mv ./* ${{runner.temp}}/sft
# Checkout ngen
- name: checkout actions in another repo
uses: actions/checkout@v4
with:
repository: noaa-owp/ngen
- name: Build SLoTH
id: submod_build_6
uses: ./.github/actions/ngen-submod-build
with:
mod-dir: "extern/sloth/"
targets: "slothmodel"
# Build Ngen and save some files
- name: Build Ngen
id: ngen_id1
uses: ./.github/actions/ngen-build
with:
targets: "ngen"
build-cores: ${{ env.LINUX_NUM_PROC_CORES }}
#is this required for this test?
bmi_c: 'ON'
timeout-minutes: 15
- name: Move LGAR-C File Including cmake_build to Appropriate Directory
run: |
if [ -d "./extern/LGAR-C/" ]; then
rm -rf extern/LGAR-C
fi
mkdir -p extern/LGAR-C/LGAR-C
mv ${{runner.temp}}/lgar/* extern/LGAR-C/LGAR-C
- name: Move SFT Files Including cmake_build to Appropriate Directory
run: |
rm -rf extern/SoilFreezeThaw/SoilFreezeThaw/*
mv ${{runner.temp}}/sft/* extern/SoilFreezeThaw/SoilFreezeThaw
- name: Move SMP Files Including cmake_build to Appropriate Directory
run: |
rm -rf extern/SoilMoistureProfiles/SoilMoistureProfiles/*
mv ${{runner.temp}}/smp/* extern/SoilMoistureProfiles/SoilMoistureProfiles
# Run ngen with sft, smp, and lasam
- name: Run Ngen Test with LASAM
run: |
mv ${{ steps.ngen_id1.outputs.build-dir }} ./ngen-build/
cp extern/LGAR-C/LGAR-C/data/vG_default_params.dat data/
inputfile='extern/LGAR-C/LGAR-C/realizations/realization_config_lasam.json'
./ngen-build/ngen ./data/catchment_data.geojson "cat-27" ./data/nexus_data.geojson "nex-26" $inputfile
- name: Run Ngen Test with SFT and SMP
run: |
inputfile='extern/LGAR-C/LGAR-C/realizations/realization_config_lasam_sft.json'
./ngen-build/ngen ./data/catchment_data.geojson "cat-27" ./data/nexus_data.geojson "nex-26" $inputfile
- name: Run Ngen Test with SMP
run: |
inputfile='extern/LGAR-C/LGAR-C/realizations/realization_config_lasam_smp.json'
./ngen-build/ngen ./data/catchment_data.geojson "cat-27" ./data/nexus_data.geojson "nex-26" $inputfile