-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
252 lines (241 loc) · 7.48 KB
/
.gitlab-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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
workflow:
auto_cancel:
on_new_commit: none
on_job_failure: none
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
auto_cancel:
on_new_commit: interruptible
on_job_failure: all
- if: $CI_PIPELINE_SOURCE == "web"
stages:
- basic
- test
.colorized:
variables:
DEFAULT: '\033[0m'
RED: '\033[0;31m'
Licenses:
stage: basic
variables:
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
before_script:
- python3 -m pip install --upgrade pip
- python3 -m pip install reuse
- reuse --version
script:
- reuse lint
# Additional license checks:
- ${CI_PROJECT_DIR}/scripts/ci_scripts/check_license.py
tags:
- sphinx
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always
interruptible: true
OpenACC Style:
stage: basic
extends: .colorized
variables:
BEAUTIFIER_TAG: "v0.3.0"
BEAUTIFIER_REPO: "https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.dkrz.de/dwd-sw/icon-openacc-beautifier.git"
GIT_SUBMODULE_STRATEGY: none
before_script:
- git clone --branch "${BEAUTIFIER_TAG}" --depth 1 "${BEAUTIFIER_REPO}"
script:
# Apply beautifier:
- python3 icon-openacc-beautifier/main.py src/
# Build git patch:
- git diff --ignore-submodules --patch-with-raw > acc_style.patch
- |
# Test if patching is necessary:
test ! -s acc_style.patch || {
printf "${RED}ERROR: There are ACC style errors. Please check your \
code. You might want to run the ACC beautifier or \`git apply acc_style.patch\` \
(see artifacts).${DEFAULT}\n" >&2
exit 1
}
tags:
# Choose python capable runner:
- sphinx
artifacts:
paths:
- acc_style.patch
expire_in: 1 week
expose_as: 'OpenACC Style Git Patch'
when: on_failure
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always
interruptible: true
General Style:
stage: basic
variables:
GIT_SUBMODULE_STRATEGY: normal
before_script:
- pip install pyyaml click pandas
script:
# TODO: we should check all ICON source files, as well as all source files
# of the bundled libraries that are built as part of ICON:
# - externals/art
# - externals/dace_icon
# - externals/emvorado
# - externals/jsbach
# However, we cannot currently do that because they will fail the tests.
# Therefore, we check as many of them as possible:
- ./scripts/ci_scripts/check_encoding.sh 'src' 'support'
- ./scripts/ci_scripts/check_src_noexec.sh 'src' 'support'
- ./scripts/ci_scripts/check_omp_sentinels.sh 'src' 'support' 'externals/jsbach' 'externals/emvorado' 'externals/art'
- ./scripts/ci_scripts/check_granule_encapsulation.sh
- python scripts/experiments/yaml_experiment_test_processor.py
tags:
# Choose a runner with GNU find, GNU grep and bash:
- conda
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always
interruptible: true
Autoreconf:
stage: basic
extends: .colorized
variables:
AUTOCONF_VERSION: "2.69"
AUTOCONF_SHA256: 954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969
AUTOCONF_DIR: ${CI_PROJECT_DIR}/autoconf
GIT_SUBMODULE_STRATEGY: none
before_script:
- apk add --no-cache automake curl git m4 make perl
- |
# Fetching Autoconf
test -f "${AUTOCONF_DIR}/autoconf-${AUTOCONF_VERSION}.tar.gz" && \
echo "${AUTOCONF_SHA256} ${AUTOCONF_DIR}/autoconf-${AUTOCONF_VERSION}.tar.gz" | sha256sum -c || \
(
set -x
mkdir -p "${AUTOCONF_DIR}" && \
cd "${AUTOCONF_DIR}" && \
{
curl -OL --connect-timeout 10 "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz" || \
curl -L -o "autoconf-${AUTOCONF_VERSION}.tar.gz" "https://mirror.spack.io/_source-cache/archive/${AUTOCONF_SHA256:0:2}/${AUTOCONF_SHA256}.tar.gz"
} && \
echo "${AUTOCONF_SHA256} autoconf-${AUTOCONF_VERSION}.tar.gz" | sha256sum -c
) || {
printf "${RED}ERROR: failed to fetch Autoconf ${AUTOCONF_VERSION}${DEFAULT}\n"
exit 1
}
- |
# Installing Autoconf
(
set -x
cd "${AUTOCONF_DIR}" && \
tar xfz autoconf-${AUTOCONF_VERSION}.tar.gz --strip-components=1 && \
./configure && \
make -j4 install
) || {
printf "${RED}ERROR: failed to install Autoconf ${AUTOCONF_VERSION}${DEFAULT}\n"
exit 1
}
script:
- autoreconf -fvi
- git diff --ignore-submodules --patch-with-raw > autoreconf.patch
- |
# Checking the consistency
test ! -s autoreconf.patch || {
printf "${RED}ERROR: the automatically generated Autotools files \
(e.g. 'configure') are inconsistent with 'configure.ac' and/or \
Autoconf ${AUTOCONF_VERSION} (see artifacts)${DEFAULT}\n"
exit 1
}
tags:
- alpine
cache:
policy: push
key: ${AUTOCONF_SHA256}
paths:
- ${AUTOCONF_DIR}/autoconf-${AUTOCONF_VERSION}.tar.gz
artifacts:
paths:
- autoreconf.patch
expire_in: 1 week
expose_as: 'Autoreconf Git Patch'
when: on_failure
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- ${CI_CONFIG_PATH}
- config.h.in
- configure
- configure.ac
- m4/**/*
- utils/config.guess
- utils/config.sub
- utils/install-sh
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always
interruptible: true
Iconbot:
stage: basic
variables:
ICONBOT_TAG: production
ICONBOT_REPO: "https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.dkrz.de/mpim-sw/iconbot.git"
ICONBOT_DIR: iconbot
ICONBOT_CONFIG: .gitlab/iconbot/notifier.yml
GIT_SUBMODULE_STRATEGY: none
before_script:
- git clone --branch "${ICONBOT_TAG}" --depth 1 "${ICONBOT_REPO}" "${ICONBOT_DIR}"
script:
- python3 -m pip install -r "${ICONBOT_DIR}/requirements/notifier/config.txt"
- python3 "${ICONBOT_DIR}/src/notifier/config.py" "${ICONBOT_CONFIG}"
tags:
- sphinx
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- ${CI_CONFIG_PATH}
- ${ICONBOT_CONFIG}
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always
interruptible: true
Granules:
stage: test
needs: []
trigger:
include: .gitlab/ci/granules.yml
strategy: depend
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- ${CI_CONFIG_PATH}
- .gitlab/ci/granules.yml
- externals/fortran-support
- externals/math-support
- externals/probtest
- src/atm_phy_schemes/mo_lookup_tables_constants.f90
- src/atm_phy_schemes/mo_satad.f90
- src/granules/microphysics_1mom_schemes/**/*
- src/shared/mo_kind.f90
- src/shared/mo_physical_constants.f90
- test/microphysics_1mom_schemes/**/*
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
- when: always