-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path.gitlab-ci.yml
267 lines (230 loc) · 6.73 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# ----------------------------------------------------------------------
# LALSuite: Gitlab-CI configuration
#
# If you have any questions, please email [email protected], or open
# a question ticket at https://git.ligo.org/lscsoft/lalsuite/-/issues/
# ----------------------------------------------------------------------
# -- setup --------------------------------------
stages:
# make tarballs for each subpackage
- tarballs
# build packages for each subpackage
- LAL
- LALFrame
- LALMetaIO
- LALSimulation
- LALBurst
- LALInspiral
- LALInference
- LALPulsar
- LALApps
- wheels
# end-to-end tests
- integration tests
- compiler tests
- platform tests
- upgrade tests
# build containers
- docker
# quality checks
- coverage
- lint
# documentation
- documentation
# deploy packages
- deploy
include:
# include job templates from the gitlab-ci-templates repo
# see https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
file:
# helpers for codequality jobs
- codequality.yml
# helpers for debian builds
- debian.yml
# helpers for RHEL builds
- rhel.yml
# a flake8 job template
- python.yml
# CI rules
- local: '/.gitlab/ci/rules.yml'
# make tarballs for each subpackage
- local: '/.gitlab/ci/tarballs.yml'
# build packages for each subpackage
- local: '/.gitlab/ci/conda.yml'
- local: '/.gitlab/ci/deb.yml'
- local: '/.gitlab/ci/pkg.yml'
- local: '/.gitlab/ci/rpm.yml'
- local: '/.gitlab/ci/wheels.yml'
# end-to-end tests
- local: '/.gitlab/ci/integration.yml'
- local: '/.gitlab/ci/compilers.yml'
- local: '/.gitlab/ci/platform.yml'
- local: '/.gitlab/ci/upgrade.yml'
# build containers
- local: '/.gitlab/ci/containers.yml'
# quality checks
- local: '/.gitlab/ci/coverage.yml'
- local: '/.gitlab/ci/lint.yml'
# documentation
- local: '/.gitlab/ci/docs.yml'
# deploy packages
# - wheels: see .gitlab/ci/wheels.yml
# -- global settings ----------------------------
# by default cache everything in the .cache directory
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache
variables:
PIPELINE_NAME: "LALSuite CI/CD"
# run autoreconf in pedantic and loud mode
AUTORECONF: "autoreconf --verbose --warnings=error"
# version of python to use for builds
LALSUITE_PYTHON_VERSION: "3.10"
# gitlab runners have 4 cores per job
CPU_COUNT: 4
# don't need git history
GIT_DEPTH: 1
# global build helpers
VERBOSE: "true"
# where to store files, ideally everything that is 'cache'
# should go under ${CI_PROJECT_DIR}/.cache to match the
# cache key setting above
XDG_CONFIG_HOME: "${CI_PROJECT_DIR}/.config"
XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache"
CCACHE_DIR: "${CI_PROJECT_DIR}/.cache/ccache"
CONDA_PKGS_DIRS: "${CI_PROJECT_DIR}/.cache/conda/pkgs"
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pipe"
# where to build conda environments (i.e. not in ~/.conda)
CONDA_ENVS_PATH: "${CI_PROJECT_DIR}/envs"
# what file to use for conda configuration
CONDARC: "${CI_PROJECT_DIR}/.condarc"
# tell Debian-based installers to run non-interactively
DEBIAN_FRONTEND: noninteractive
# default parameters for jobs
default:
# retry running jobs on failure
retry: 1
# cancel job when a newer pipeline starts
interruptible: true
# -- helper fragments ----------------------------------
# to use:
# - !reference [.name-of-fragment]
# simple bash command to retry a stage up to 3 times
# with a 15-second delay (mainly to survive transient
# network issues)
#
# set RETRY_EXIT_PATTERN to an awk pattern to exit the
# command if the pattern is detected in its output
#
# set RETRY_CLEANUP to a cleanup command to execute
# before re-attempting the command
.retry: |
RETRY_EXIT_PATTERN=
RETRY_CLEANUP=
retry() {
local n=1
local max=3
local delay=15
local awkprog="{print}"
if [[ "X${RETRY_EXIT_PATTERN}" != X ]]; then
awkprog="${awkprog} ${RETRY_EXIT_PATTERN} {exit 1}"
fi
while true; do
if ( set -o pipefail; "$@" 2>&1 | awk "${awkprog}" ); then
break
else
if [[ ${n} -lt ${max} ]]; then
((n++))
echo "retry: command failed: $@"
echo "retry: cleaning up: ${RETRY_CLEANUP}"
eval ${RETRY_CLEANUP}
echo "retry: sleeping for ${delay} seconds..."
sleep ${delay};
echo "retry: attempt ${n}/${max}: $@"
else
echo "retry: command failed after ${n} attempts: $@" >&2
exit 1
fi
fi
done
}
# basic steps for a job that compiles stuff
.build-init:
# do not save coredumps
- ulimit -S -c 0
# set up ccache
- export PATH=/usr/lib/ccache:/opt/local/libexec/ccache:$PATH
# print environment for debugging
- echo "===== env ====="
- env
- echo "----- env -----"
# -- base templates ----------------------------------
# basic before_script template for a compiling job
.build-job:
timeout: 3 hours
before_script:
- !reference [.build-init]
# helper template for jobs running on macOS
.macos-job:
variables:
# use the clone strategy so permissions are correctly reset on any failed jobs
# see: https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/3726
GIT_STRATEGY: clone
# Clang has weird bugs when compiling with CFLAGS=-O3
CFLAGS: "-O2"
# tag for macOS x86_64 architecture jobs
.macos-x86_64:
extends:
- .macos-job
tags:
- macos_x86_64
# tag for macOS arm64 architecture jobs
.macos-arm64:
extends:
- .macos-job
tags:
- macos_arm64
# deploy outputs to various locations
.deploy:
stage: deploy
variables:
GIT_STRATEGY: none
retry: 0
interruptible: false
# -- CI job templates ----------------------------------
# a top-level build runs the standard boot/configure/make
# cycle with some sensible defaults
.make-distcheck:
extends:
- .build-job
variables:
# default configure flags (can be overridden from dependents)
CONFIGURE_FLAGS: "--enable-doxygen --enable-python --enable-swig-python"
# default C flags (can be overridden from dependents)
CFLAGS: "-O3"
# target to actually run (distcheck is the most thorough)
MAKE_TARGET: "distcheck"
needs: []
script:
- ./00boot
# we use xargs here in case CONFIGURE_FLAGS contains
# variables with spaces, etc etc
- xargs ./configure
--enable-strict-defs
${ENABLE_NIGHTLY}
CFLAGS="${CFLAGS}"
LALSUITE_LIBTOOL_NO_SUPPRESS=1
<<< ${CONFIGURE_FLAGS}
- make -j${CPU_COUNT} VERBOSE=1 ${MAKE_TARGET:-distcheck}
artifacts:
# upload some files to debug failures
paths:
- config.log
- Makefile
- lal*/config.log
- lal*/libtool
- lal*/Makefile
- lal*/**/test-suite.log
when: on_failure