Skip to content

Commit dd8d798

Browse files
committed
test RT CI
1 parent 2f2be9d commit dd8d798

File tree

1 file changed

+168
-169
lines changed

1 file changed

+168
-169
lines changed

.github/workflows/ci_run_scm_rts.yml

Lines changed: 168 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -38,151 +38,151 @@ jobs:
3838
# Workflow steps
3939
steps:
4040
# Install System Dependencies
41-
# - name: Install System Dependencies
42-
# run: |
43-
# sudo apt-get update -qq && sudo apt-get install -qq -y --no-install-recommends \
44-
# gfortran-${{matrix.fortran-compiler}} \
45-
# libhdf5-dev \
46-
# libnetcdf-pnetcdf-19 \
47-
# libnetcdff7 \
48-
# libnetcdf-dev \
49-
# libnetcdff-dev \
50-
# libxml2 \
51-
# openmpi-bin \
52-
# libopenmpi-dev
53-
#
54-
# # Python setup
55-
# - name: Setup Python
56-
# uses: actions/setup-python@v6
57-
# with:
58-
# python-version: ${{matrix.py-version}}
59-
#
60-
# - name: Install NetCDF Python libraries
61-
# run: |
62-
# pip install f90nml h5py netCDF4 matplotlib
63-
#
64-
# - name: Environment for openmpi compiler
65-
# run: |
66-
# echo "FC=mpif90" >> $GITHUB_ENV
67-
# echo "CC=mpicc" >> $GITHUB_ENV
68-
#
69-
# - name: Check MPI version
70-
# run: |
71-
# which mpif90
72-
# mpif90 --version
73-
#
74-
# # Install NCEP libs
75-
# - name: Cache bacio library v2.4.1
76-
# id: cache-bacio-fortran
77-
# uses: actions/cache@v4
78-
# with:
79-
# path: /home/runner/bacio
80-
# key: cache-bacio-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
81-
#
82-
# - name: Install bacio library v2.4.1
83-
# if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
84-
# run: |
85-
# git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
86-
# cd bacio && mkdir build && cd build
87-
# cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
88-
# make -j2
89-
# make install
90-
# echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
91-
#
92-
# - name: Cache SP-library v2.3.3
93-
# id: cache-sp-fortran
94-
# uses: actions/cache@v4
95-
# with:
96-
# path: /home/runner/NCEPLIBS-sp
97-
# key: cache-sp-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
98-
#
99-
# - name: Install SP-library v2.3.3
100-
# if: steps.cache-sp-fortran.outputs.cache-hit != 'true'
101-
# run: |
102-
# git clone --branch v2.3.3 https://github.com/NOAA-EMC/NCEPLIBS-sp.git NCEPLIBS-sp
103-
# cd NCEPLIBS-sp && mkdir build && cd build
104-
# cmake -DCMAKE_INSTALL_PREFIX=${sp_ROOT} ../
105-
# make -j2
106-
# make install
107-
# echo "sp_DIR=/home/runner/NCEPLIBS-sp/lib/cmake/sp" >> $GITHUB_ENV
108-
#
109-
# - name: Cache w3emc library v2.9.2
110-
# id: cache-w3emc-fortran
111-
# uses: actions/cache@v4
112-
# with:
113-
# path: /home/runner/myw3emc
114-
# key: cache-w3emc-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
115-
#
116-
# - name: Install w3emc library v2.9.2
117-
# if: steps.cache-w3emc-fortran.outputs.cache-hit != 'true'
118-
# run: |
119-
# git clone --branch v2.9.2 https://github.com/NOAA-EMC/NCEPLIBS-w3emc.git NCEPLIBS-w3emc
120-
# cd NCEPLIBS-w3emc && mkdir build && cd build
121-
# cmake -DCMAKE_INSTALL_PREFIX=${w3emc_ROOT} ../
122-
# make -j2
123-
# make install
124-
# echo "w3emc_DIR=/home/runner/myw3emc/lib/cmake/w3emc" >> $GITHUB_ENV
125-
#
126-
#
127-
# # Initialize and build SCM, run regressions tests
128-
# - name: Checkout SCM code (into /home/runner/work/ccpp-scm/)
129-
# uses: actions/checkout@v5
130-
#
131-
# - name: Initialize submodules
132-
# run: git submodule update --init --recursive
133-
#
134-
# - name: Download data for SCM
135-
# run: |
136-
# cd ${SCM_ROOT}
137-
# ./contrib/get_all_static_data.sh
138-
# ./contrib/get_thompson_tables.sh
139-
# ./contrib/get_tempo_data.sh
140-
# ./contrib/get_aerosol_climo.sh
141-
# ./contrib/get_rrtmgp_data.sh
142-
#
143-
# - name: Configure build with CMake (Release)
144-
# if: contains(matrix.build-type, 'Release')
145-
# run: |
146-
# cd ${SCM_ROOT}/scm
147-
# mkdir bin && cd bin
148-
# cmake -DCCPP_SUITES=${suites},${suites_ps} ../src
149-
#
150-
# - name: Configure build with CMake (Debug)
151-
# if: contains(matrix.build-type, 'Debug')
152-
# run: |
153-
# cd ${SCM_ROOT}/scm
154-
# mkdir bin && cd bin
155-
# cmake -DCCPP_SUITES=${suites},${suites_ps} -DCMAKE_BUILD_TYPE=Debug ../src
156-
#
157-
# - name: Configure build with CMake (Single Precision)
158-
# if: matrix.build-type == 'SinglePrecision'
159-
# run: |
160-
# cd ${SCM_ROOT}/scm
161-
# mkdir bin && cd bin
162-
# cmake -DCCPP_SUITES=${suites},${suites_ps} -D32BIT=1 ../src
163-
#
164-
# - name: Build SCM
165-
# run: |
166-
# cd ${SCM_ROOT}/scm/bin
167-
# make -j4
168-
#
169-
# - name: Run SCM RTs
170-
# if: matrix.build-type != 'SinglePrecision'
171-
# run: |
172-
# cd ${SCM_ROOT}/scm/bin
173-
# ./run_scm.py --file /home/runner/work/ccpp-scm/ccpp-scm/test/rt_test_cases.py --runtime_mult 0.1
174-
#
175-
# - name: Run SCM Single Precision RTs
176-
# if: matrix.build-type == 'SinglePrecision'
177-
# run: |
178-
# cd ${SCM_ROOT}/scm/bin
179-
# ./run_scm.py --file /home/runner/work/ccpp-scm/ccpp-scm/test/rt_test_cases_sp.py --runtime_mult 0.1
180-
#
181-
# - name: Gather SCM RT output
182-
# run: |
183-
# cd ${SCM_ROOT}/test
184-
# mkdir /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}}
185-
# ./ci_util.py -b ${{matrix.build-type}}
41+
- name: Install System Dependencies
42+
run: |
43+
sudo apt-get update -qq && sudo apt-get install -qq -y --no-install-recommends \
44+
gfortran-${{matrix.fortran-compiler}} \
45+
libhdf5-dev \
46+
libnetcdf-pnetcdf-19 \
47+
libnetcdff7 \
48+
libnetcdf-dev \
49+
libnetcdff-dev \
50+
libxml2 \
51+
openmpi-bin \
52+
libopenmpi-dev
53+
54+
# Python setup
55+
- name: Setup Python
56+
uses: actions/setup-python@v6
57+
with:
58+
python-version: ${{matrix.py-version}}
59+
60+
- name: Install NetCDF Python libraries
61+
run: |
62+
pip install f90nml h5py netCDF4 matplotlib
63+
64+
- name: Environment for openmpi compiler
65+
run: |
66+
echo "FC=mpif90" >> $GITHUB_ENV
67+
echo "CC=mpicc" >> $GITHUB_ENV
68+
69+
- name: Check MPI version
70+
run: |
71+
which mpif90
72+
mpif90 --version
73+
74+
# Install NCEP libs
75+
- name: Cache bacio library v2.4.1
76+
id: cache-bacio-fortran
77+
uses: actions/cache@v4
78+
with:
79+
path: /home/runner/bacio
80+
key: cache-bacio-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
81+
82+
- name: Install bacio library v2.4.1
83+
if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
84+
run: |
85+
git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
86+
cd bacio && mkdir build && cd build
87+
cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
88+
make -j2
89+
make install
90+
echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
91+
92+
- name: Cache SP-library v2.3.3
93+
id: cache-sp-fortran
94+
uses: actions/cache@v4
95+
with:
96+
path: /home/runner/NCEPLIBS-sp
97+
key: cache-sp-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
98+
99+
- name: Install SP-library v2.3.3
100+
if: steps.cache-sp-fortran.outputs.cache-hit != 'true'
101+
run: |
102+
git clone --branch v2.3.3 https://github.com/NOAA-EMC/NCEPLIBS-sp.git NCEPLIBS-sp
103+
cd NCEPLIBS-sp && mkdir build && cd build
104+
cmake -DCMAKE_INSTALL_PREFIX=${sp_ROOT} ../
105+
make -j2
106+
make install
107+
echo "sp_DIR=/home/runner/NCEPLIBS-sp/lib/cmake/sp" >> $GITHUB_ENV
108+
109+
- name: Cache w3emc library v2.9.2
110+
id: cache-w3emc-fortran
111+
uses: actions/cache@v4
112+
with:
113+
path: /home/runner/myw3emc
114+
key: cache-w3emc-fortran-${{matrix.fortran-compiler}}-${{matrix.build-type}}-key
115+
116+
- name: Install w3emc library v2.9.2
117+
if: steps.cache-w3emc-fortran.outputs.cache-hit != 'true'
118+
run: |
119+
git clone --branch v2.9.2 https://github.com/NOAA-EMC/NCEPLIBS-w3emc.git NCEPLIBS-w3emc
120+
cd NCEPLIBS-w3emc && mkdir build && cd build
121+
cmake -DCMAKE_INSTALL_PREFIX=${w3emc_ROOT} ../
122+
make -j2
123+
make install
124+
echo "w3emc_DIR=/home/runner/myw3emc/lib/cmake/w3emc" >> $GITHUB_ENV
125+
126+
127+
# Initialize and build SCM, run regressions tests
128+
- name: Checkout SCM code (into /home/runner/work/ccpp-scm/)
129+
uses: actions/checkout@v5
130+
131+
- name: Initialize submodules
132+
run: git submodule update --init --recursive
133+
134+
- name: Download data for SCM
135+
run: |
136+
cd ${SCM_ROOT}
137+
./contrib/get_all_static_data.sh
138+
./contrib/get_thompson_tables.sh
139+
./contrib/get_tempo_data.sh
140+
./contrib/get_aerosol_climo.sh
141+
./contrib/get_rrtmgp_data.sh
142+
143+
- name: Configure build with CMake (Release)
144+
if: contains(matrix.build-type, 'Release')
145+
run: |
146+
cd ${SCM_ROOT}/scm
147+
mkdir bin && cd bin
148+
cmake -DCCPP_SUITES=${suites},${suites_ps} ../src
149+
150+
- name: Configure build with CMake (Debug)
151+
if: contains(matrix.build-type, 'Debug')
152+
run: |
153+
cd ${SCM_ROOT}/scm
154+
mkdir bin && cd bin
155+
cmake -DCCPP_SUITES=${suites},${suites_ps} -DCMAKE_BUILD_TYPE=Debug ../src
156+
157+
- name: Configure build with CMake (Single Precision)
158+
if: matrix.build-type == 'SinglePrecision'
159+
run: |
160+
cd ${SCM_ROOT}/scm
161+
mkdir bin && cd bin
162+
cmake -DCCPP_SUITES=${suites},${suites_ps} -D32BIT=1 ../src
163+
164+
- name: Build SCM
165+
run: |
166+
cd ${SCM_ROOT}/scm/bin
167+
make -j4
168+
169+
- name: Run SCM RTs
170+
if: matrix.build-type != 'SinglePrecision'
171+
run: |
172+
cd ${SCM_ROOT}/scm/bin
173+
./run_scm.py --file /home/runner/work/ccpp-scm/ccpp-scm/test/rt_test_cases.py --runtime_mult 0.1
174+
175+
- name: Run SCM Single Precision RTs
176+
if: matrix.build-type == 'SinglePrecision'
177+
run: |
178+
cd ${SCM_ROOT}/scm/bin
179+
./run_scm.py --file /home/runner/work/ccpp-scm/ccpp-scm/test/rt_test_cases_sp.py --runtime_mult 0.1
180+
181+
- name: Gather SCM RT output
182+
run: |
183+
cd ${SCM_ROOT}/test
184+
mkdir /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}}
185+
./ci_util.py -b ${{matrix.build-type}}
186186
187187
- name: Save Artifact Id Numbers and Create Directory for SCM RT baselines
188188
run: |
@@ -203,28 +203,27 @@ jobs:
203203

204204
- name: Compare SCM RT output to baselines
205205
run: |
206-
ls -R ${dir_bl}
207-
# cd ${SCM_ROOT}/test
208-
# ./cmp_rt2bl.py --dir_rt ${dir_rt} --dir_bl ${dir_bl}
206+
cd ${SCM_ROOT}/test
207+
./cmp_rt2bl.py --dir_rt ${dir_rt} --dir_bl ${dir_bl}
209208
210-
# - name: Check if SCM RT plots exist
211-
# id: check_files
212-
# run: |
213-
# if [ -n "$(ls -A /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out 2>/dev/null)" ]; then
214-
# echo "files_exist=true" >> "$GITHUB_ENV"
215-
# else
216-
# echo "files_exist=false" >> "$GITHUB_ENV"
217-
# fi
218-
#
219-
# - name: Upload plots of SCM Baselines/RTs as GitHub Artifact.
220-
# if: env.files_exist == 'true'
221-
# uses: actions/upload-artifact@v5
222-
# with:
223-
# name: rt-plots-${{matrix.build-type}}-${{ env.artifact_origin }}
224-
# path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out
225-
#
226-
# - name: Upload SCM RTs as GitHub Artifact
227-
# uses: actions/upload-artifact@v5
228-
# with:
229-
# name: rt-baselines-${{matrix.build-type}}-${{ env.artifact_origin }}
230-
# path: /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}}
209+
- name: Check if SCM RT plots exist
210+
id: check_files
211+
run: |
212+
if [ -n "$(ls -A /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out 2>/dev/null)" ]; then
213+
echo "files_exist=true" >> "$GITHUB_ENV"
214+
else
215+
echo "files_exist=false" >> "$GITHUB_ENV"
216+
fi
217+
218+
- name: Upload plots of SCM Baselines/RTs as GitHub Artifact.
219+
if: env.files_exist == 'true'
220+
uses: actions/upload-artifact@v5
221+
with:
222+
name: rt-plots-${{matrix.build-type}}-${{ env.artifact_origin }}
223+
path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out
224+
225+
- name: Upload SCM RTs as GitHub Artifact
226+
uses: actions/upload-artifact@v5
227+
with:
228+
name: rt-baselines-${{matrix.build-type}}-${{ env.artifact_origin }}
229+
path: /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}}

0 commit comments

Comments
 (0)