-
Notifications
You must be signed in to change notification settings - Fork 69
130 lines (129 loc) · 4.38 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
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: Continuous integration in a box
on:
push:
branches-ignore:
- documentation
pull_request:
branches-ignore:
- documentation
jobs:
Containerized-CI:
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
fortran-compiler: [ifort, ifx, nvfortran]
rte-kernels: [default, accel]
fpmodel: [DP, SP]
include:
# The tests are not experimental by default:
- experimental: false
# Disable GPU support to use the default kernels:
- rte-kernels: default
enable-gpu: no
# Enable GPU support with OpenMP for Intel Fortran Compiler Classic but
# ignore the directives:
- fortran-compiler: ifort
rte-kernels: accel
enable-gpu: openmp
extra-config-args: acx_cv_fc_openmp_flag=
# Enable GPU support with OpenMP for Intel Fortran Compiler:
- fortran-compiler: ifx
rte-kernels: accel
enable-gpu: openmp
# Enable GPU support with OpenACC for NVIDIA Fortran Compiler:
- fortran-compiler: nvfortran
rte-kernels: accel
enable-gpu: openacc
# Set flags for Intel Fortran Compiler Classic:
- fortran-compiler: ifort
fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08
# Set flags for Intel Fortran Compiler:
- fortran-compiler: ifx
rte-kernels: default
fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08
- fortran-compiler: ifx
rte-kernels: accel
fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 -fiopenmp -fopenmp-targets=spir64
# The compiler produces two module files per Fortran module, which
# confuses the configure script:
extra-config-args: acx_cv_fc_module_naming_ext=mod
experimental: true
# Set flags for NVIDIA Fortran Compiler:
- fortran-compiler: nvfortran
fcflags: -Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk
# Set container images:
- fortran-compiler: ifort
image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:ifort
- fortran-compiler: ifx
image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:ifort
- fortran-compiler: nvfortran
image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:nvfortran
container:
image: ${{ matrix.image }}
env:
# Core variables:
FC: ${{ matrix.fortran-compiler }}
FCFLAGS: ${{ matrix.fcflags }}
# Configure script variables:
LAUNCH_PREFIX:
# Auxiliary variables:
NFHOME: /opt/netcdf-fortran
RFMIP_CACHEDIR: .testcache
steps:
#
# Checks-out repository under $GITHUB_WORKSPACE
#
- uses: actions/checkout@v4
#
# Cache RFMIP files
#
- name: Cache RFMIP files
uses: actions/cache@v3
with:
path: ${{ env.RFMIP_CACHEDIR }}
key: rfmip-files-autoconf
#
# Configure
#
- name: Configure
run: |
test 'x${{ matrix.fpmodel }}' = xSP && enable_sp=yes || enable_sp=no
./configure \
--disable-examples \
--disable-silent-rules \
--enable-gpu='${{ matrix.enable-gpu }}' \
--enable-single-precision="${enable_sp}" \
--enable-tests \
--with-netcdf-fortran="${NFHOME}" \
${{ matrix.extra-config-args }} \
|| { cat ./config.log; exit 1; }
#
# Build
#
- name: Build
run: make -j
#
# Check
#
- name: Check
run: |
make -j check
find . -name '*.test' | sort | sed 's|.test$|.log|' | while read file; do echo "$file"; cat "$file"; done
#
# Generate validation plots
#
- name: Generate validation plots
if: matrix.fortran-compiler == 'ifort' && matrix.rte-kernels == 'default' && matrix.fpmodel == 'DP'
working-directory: tests
run: python validation-plots.py
#
# Upload validation plots
#
- name: Upload validation plots
if: matrix.fortran-compiler == 'ifort' && matrix.rte-kernels == 'default' && matrix.fpmodel == 'DP'
uses: actions/upload-artifact@v3
with:
name: valdiation-plot
path: tests/validation-figures.pdf