forked from earth-system-radiation/rte-rrtmgp
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (102 loc) · 3.03 KB
/
containerized-ci.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
name: Continuous integration in a box
on:
push:
branches-ignore:
- documentation
pull_request:
branches-ignore:
- documentation
jobs:
Containerized-CI:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
fortran-compiler: [ifort, ifx, nvfortran]
rte-kernels: [default, openacc]
include:
- fortran-compiler: ifort
fcflags: "-m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08"
image: "earthsystemradiation/rte-rrtmgp-ci:ifort"
- fortran-compiler: ifx
fcflags: "-m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08"
image: "earthsystemradiation/rte-rrtmgp-ci:ifort"
- fortran-compiler: nvfortran
fcflags: "-Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk"
image: "earthsystemradiation/rte-rrtmgp-ci:nvfortran"
container:
image: ${{ matrix.image }}
env:
# Core variables:
FC: ${{ matrix.fortran-compiler }}
FCFLAGS: ${{ matrix.fcflags }}
# Make variables:
NCHOME: /dummy
NFHOME: /opt/netcdf-fortran
RRTMGP_ROOT: ${{ github.workspace }}
RTE_KERNELS: ${{ matrix.rte-kernels }}
RUN_CMD:
# Auxiliary variables:
RFMIP_CACHEDIR: /home/runner/rfmip-files
steps:
#
# Checks-out repository under $GITHUB_WORKSPACE
#
- uses: actions/checkout@v3
#
# Cache RFMIP files
#
- name: Cache RFMIP files
uses: actions/cache@v3
with:
path: ${{ env.RFMIP_CACHEDIR }}
key: rfmip-files
#
# Stage RFMIP files
#
- name: Stage RFMIP files
run: |
if test ! -d "${RFMIP_CACHEDIR}"; then
mkdir -p "${RFMIP_CACHEDIR}" && cd "${RFMIP_CACHEDIR}"
python "${GITHUB_WORKSPACE}/examples/rfmip-clear-sky/stage_files.py"
fi
for file in "${RFMIP_CACHEDIR}"/*; do
if test ! -d "${file}"; then
echo "copying '${file}'..."
cp "${file}" "${GITHUB_WORKSPACE}/examples/rfmip-clear-sky/"
fi
done
#
# Build libraries, examples and tests
#
- name: Build libraries, examples and tests
run: |
$FC --version
make libs
make -C build separate-libs
#
# Run examples and tests
#
- name: Run examples and tests
run: make tests
#
# Compare the results
#
- name: Compare the results
run: make check
#
# Generate validation plots
#
- name: Generate validation plots
if: matrix.fortran-compiler == 'ifort' && matrix.rte-kernels == 'default'
working-directory: tests
run: python validation-plots.py
#
# Upload validation plots
#
- name: Upload validation plots
if: matrix.fortran-compiler == 'ifort' && matrix.rte-kernels == 'default'
uses: actions/upload-artifact@v3
with:
name: valdiation-plot
path: tests/validation-figures.pdf