forked from NCAR/noahmp
-
Notifications
You must be signed in to change notification settings - Fork 14
130 lines (118 loc) · 4.29 KB
/
datm_noahmp.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
name: Test NUOPC cap
env:
# default compiler version
compiler: gcc@latest
# default esmf version
esmf_version: 'esmf@develop'
# default test name
test: test_datm_lnd
# set token to access gh command
GH_TOKEN: ${{ github.token }}
# installation location for application
APP_INSTALL_DIR: ${{ github.workspace }}/app
# installation location for dependencies
DEP_INSTALL_DIR: ~/.spack-ci
# option for retention period for artifacts, default is 90 days
ARTIFACTS_RETENTION_PERIOD: 2
on:
push:
branches: [ develop ]
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches: [ develop ]
schedule:
- cron: '0 0 * * MON'
- cron: '0 0 * * FRI'
workflow_dispatch:
inputs:
compiler:
description: 'Compiler version like gcc@12.3.0 or gcc@latest (latest available version on runner)'
required: false
type: string
default: 'gcc@latest'
esmf_version:
description: 'ESMF version or tag: esmf@develop, esmf@=8.5.0b23, esmf@git.hconfig_change_equal=8.6.0'
required: false
type: string
default: 'esmf@develop'
test:
description: 'Test that will be run'
required: false
type: string
default: test_datm_lnd
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
# generete matrix
- name: Generate Matrix by Listing Compiler and ESMF Packages
id: generate
run: |
# output variables for debugging
echo "INPUT: >${{ inputs.compiler }}< >${{ inputs.esmf_version }}<"
echo "ENV : >${{ env.compiler }}< >${{ env.esmf_version }}<"
# create matrix JSON file
# compiler
if [ -z "${{ inputs.compiler }}" ]; then
str1="{\"compiler\": [\"${{ env.compiler }}\"],"
else
str1="{\"compiler\": [\"${{ inputs.compiler }}\"],"
fi
# esmf
if [ -z "${{ inputs.esmf_version }}" ]; then
str2="\"esmf\": [\"${{ env.esmf_version }}+external-parallelio\"],"
else
str2="\"esmf\": [\"${{ inputs.esmf_version }}+external-parallelio\"],"
fi
# test
if [ -z "${{ inputs.test }}" ]; then
str3="\"test\": [\"${{ env.test }}\"]}"
else
str3="\"test\": [\"${{ inputs.test }}\"]}"
fi
# output contect for debugging
echo "matrix=${str1}${str2}${str3}"
# output for next step
echo "matrix=${str1}${str2}${str3}" >> $GITHUB_OUTPUT
build:
needs: set-matrix
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
steps:
# test component
- name: Test Component
uses: esmf-org/nuopc-comp-testing@feature/v1.3
with:
app_install_dir: ${{ env.APP_INSTALL_DIR }}
artifacts_name: artifacts for ${{ matrix.test }} ${{ matrix.compiler }} ${{ matrix.esmf }}
artifacts_files: |
${{ env.APP_INSTALL_DIR }}/run/PET*
${{ env.APP_INSTALL_DIR }}/run/*.txt
${{ env.APP_INSTALL_DIR }}/run/*.log
${{ env.APP_INSTALL_DIR }}/run/comp.test.lnd.out.2000-01-01-75600.*
baseline_files: |
${{ env.APP_INSTALL_DIR }}/run/comp.test.*.nc
cache_input_file_list: |
${{ env.APP_INSTALL_DIR }}/run/INPUT
${{ env.APP_INSTALL_DIR }}/run/fd_nems.yaml
component_build: |
export PATH=${{ env.DEP_INSTALL_DIR }}/view/bin:$PATH
export ESMFMKFILE=${{ env.DEP_INSTALL_DIR }}/view/lib/esmf.mk
export NetCDF_ROOT=${{ env.DEP_INSTALL_DIR }}/view
export FC=gfortran
cd ${{ env.APP_INSTALL_DIR }}/noahmp
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${{ env.APP_INSTALL_DIR }} -DCMAKE_Fortran_FLAGS=\"-g -fbacktrace\" ../
make
make install
component_module_name: lnd_comp_nuopc.mod
data_component_name: datm
dependencies: |
${{ matrix.esmf }}
dependencies_install_dir: ${{ env.DEP_INSTALL_DIR }}
mpirun_args: --oversubscribe -np 6 --mca btl_tcp_if_include eth0
test_definition: ${{ env.APP_INSTALL_DIR }}/noahmp/.github/workflows/tests/${{ matrix.test }}.yaml