-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
357 lines (315 loc) · 9.8 KB
/
.gitlab-ci.yml
File metadata and controls
357 lines (315 loc) · 9.8 KB
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
variables:
#year: "2025"
#month: "09"
#download_url: "https://common-lisp.net/project/cmucl/downloads/snapshots/$year/$month"
#version: "$year-$month-x86"
release: "21f"
download_url: "https://common-lisp.net/project/cmucl/downloads/release/$release"
version: "$release-x86"
tar_ext: "xz"
bootstrap: ""
workflow:
rules:
# Always run on schedules (for analyze and markdown-link-check stages)
- if: $CI_PIPELINE_SOURCE == "schedule"
# Run on merge requests
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Run on the default branch (where there's no MR)
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Run on feature branches, but only if there's no open MR (to avoid
# duplicate pipelines).
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
# Run on tags
- if: $CI_COMMIT_TAG
# Default install configuration to download the cmucl tarballs to use
# for building.
.install:
stage: install
artifacts:
paths:
- snapshot/
script:
- echo PATH = $PATH
- ls -F /usr/local/bin
# Make sure gitlab-runner is available because it's needed by the
# VM to upload artifacts.
- type -all gitlab-runner
# Download binaries. (Do we really need the extras tarball?)
- $CURL -o cmucl-$version-$osname.tar.$tar_ext $download_url/cmucl-$version-$osname.tar.$tar_ext
- $CURL -o cmucl-$version-$osname.extra.tar.$tar_ext $download_url/cmucl-$version-$osname.extra.tar.$tar_ext
- mkdir snapshot
- (cd snapshot; tar xf ../cmucl-$version-$osname.tar.$tar_ext; tar xf ../cmucl-$version-$osname.extra.tar.$tar_ext)
# Default build configuration to be added to each build stage for each
# OS. This assumes we don't need anything special between OSes, and
# the option '-C ""' is good enough. We also override the default
# build dirs by using the -b option so that we know where the results
# are, independent of OS.
.build:
stage: build
artifacts:
paths:
- dist/
- build-2/*.log
- build-3/*.log
- build-4/
- cmucl*
# Needed by Linux analyzer stage
- src/lisp/cmucl-version.h
# Save this so we can see the generated errno
- src/code/errno.lisp
script:
# Do cross compile first
#- bin/create-target.sh xtarget x86_linux_clang
#- bin/create-target.sh xcross x86_linux_clang
#- bin/cross-build-world.sh -crl -B boot-2020-04-1 xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp
# Regular build using the cross-compiled result or snapshot. The
# analyzer job requires gcc, so make sure we build with gcc here
# instead of clang.
#
# Set CONFIG in appropriately each build.
- bin/build.sh $bootstrap -b build -R -C $CONFIG -o snapshot/bin/lisp
# When the result of `git describe` cannot be used as a version
# string, an alternative can be provided with the -V flag
# The following stages need this to run tests and such.
- sh -x bin/git-version.sh
- bin/make-dist.sh -I dist build-4
# Also make some tarballs so it's easy to download the artifacts.
- bin/make-dist.sh -S build-4
# Default configuration for running the ansi-tests.
.ansi-test:
stage: ansi-test
artifacts:
paths:
- ansi-test.out
script:
- bin/run-ansi-tests.sh -l dist/bin/lisp
- cp ../ansi-test/test.out ansi-test.out
# Default configuration for running unit tests.
.unit-test:
stage: test
artifacts:
paths:
- test.log
script:
- echo LANG = $LANG
- bin/run-unit-tests.sh -l dist/bin/lisp 2>&1 | tee test.log
# Default configuration to test creation of lisp executable and
# testing the exectuable works.
.exec-test:
stage: test
script:
# Create an executable and test it by printing the version.
- dist/bin/lisp -eval '(save-lisp "saved-lisp-executable" :executable t)'
- ./saved-lisp-executable --version
# Run the unit tests with the executable, just to make sure the
# executable works as expected.
- bin/run-unit-tests.sh -l ./saved-lisp-executable
# Default configuration for running the benchmarks.
.benchmark:
stage: benchmark
artifacts:
paths:
- benchmarks/cl-bench/results
script:
- cd benchmarks/cl-bench
- mkdir tmp
- CMUCL=../../snapshot/bin/lisp ./run-cmucl.sh
- CMUCL=../../dist/bin/lisp ./run-cmucl.sh
- ../../snapshot/bin/lisp -load report
# Rules shared by optional/manual jobs (static analyzer, markdown-link-check).
.optional-rules:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $RUN_CHECKS
- when: manual
allow_failure: true
# Per-platform base jobs: capture tags and the needs chain so individual
# jobs don't have to repeat them.
.linux:
tags:
- linux
.linux-needs-install:
extends: .linux
needs:
- job: linux:install
artifacts: true
.linux-needs-build:
extends: .linux
needs:
# Needs artifacts from build (dist/)
- job: linux:build
artifacts: true
.osx:
tags:
- macos-virtualbox
.osx-needs-install:
extends: .osx
needs:
- job: osx:install
artifacts: true
.osx-needs-build:
extends: .osx
needs:
# Needs artifacts from build (dist/)
- job: osx:build
artifacts: true
.ubuntu:
tags:
- ubuntu
.ubuntu-needs-install:
extends: .ubuntu
needs:
- job: ubuntu:install
artifacts: true
.ubuntu-needs-build:
extends: .ubuntu
needs:
# Needs artifacts from build (dist/)
- job: ubuntu:build
artifacts: true
stages:
- install
- build
- test
- ansi-test
- benchmark
- analyze
- markdown-link-check
cache:
#### Linux jobs ####
linux:install:
extends: [.install, .linux]
variables:
osname: "linux"
CURL: "curl"
linux:build:
extends: [.build, .linux-needs-install]
variables:
# Fedora 41 must build with gcc because the clang build fails some
# ansi-tests. See [#469].
CONFIG: "x86_linux"
linux:cross-build:
extends: .linux-needs-install
stage: build
artifacts:
paths:
- xdist/
- linux-2/*.log
- linux-3/*.log
- linux-4/*.log
# The lisp directory is needed for the static analyzer job.
- linux-4/lisp
variables:
# This must match the config used for the linux build!
CONFIG: "x86_linux"
script:
- bin/create-target.sh xtarget $CONFIG
- bin/create-target.sh xcross $CONFIG
- bin/cross-build-world.sh -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp
- bin/build.sh -b xlinux $bootstrap -R -C $CONFIG -o "xtarget/lisp/lisp -lib xtarget/lisp"
- bin/make-dist.sh -I xdist xlinux-4
linux:test:
extends: [.unit-test, .linux-needs-build]
linux:exec-test:
extends: [.exec-test, .linux-needs-build]
linux:cross-test:
extends: .linux
stage: test
artifacts:
paths:
- ansi-test/test.out
- cross-test.log
needs:
# Needs artifacts from build (dist/)
- job: linux:cross-build
artifacts: true
script:
- bin/run-unit-tests.sh -l xdist/bin/lisp 2>&1 | tee cross-test.log
linux:ansi-test:
extends: [.ansi-test, .linux-needs-build]
linux:benchmark:
extends: [.benchmark, .linux]
needs:
# Needs artifacts from install (snapshot/) and build (dist/)
- job: linux:install
artifacts: true
- job: linux:build
#### OSX (Mac) jobs ####
osx:install:
extends: [.install, .osx]
variables:
osname: "darwin"
CURL: "/opt/local/bin/curl"
osx:build:
extends: [.build, .osx-needs-install]
variables:
CONFIG: "x86_darwin"
osx:test:
extends: [.unit-test, .osx-needs-build]
osx:exec-test:
extends: [.exec-test, .osx-needs-build]
osx:ansi-test:
extends: [.ansi-test, .osx-needs-build]
osx:benchmark:
extends: [.benchmark, .osx]
needs:
# Needs artifacts from install (snapshot/) and build (dist/)
- job: osx:install
artifacts: true
- job: osx:build
# Optional job that runs the static analyzer. It needs the files from
# the linux-4 directory built in the linux:build job.
linux:static-analyzer:
extends: [.optional-rules, .linux-needs-build]
stage: analyze
artifacts:
when: always
paths:
- analyzer.log
script:
# Analysis can generate huge amounts of output. For now just save
# the results to the log file instead of also having it go to the
# console. If someday there's less or no output, we can consider
# having the logs go to the console too.
- make -C build-4/lisp clean
- make -C build-4/lisp ANALYZER=-fanalyzer > analyzer.log 2>&1
#### OpenSUSE jobs ####
ubuntu:install:
extends: [.install, .ubuntu]
variables:
osname: "linux"
CURL: "curl"
ubuntu:build:
extends: [.build, .ubuntu-needs-install]
variables:
# Build with gcc on Ubuntu 25.10. It produces a lisp than passes
# the ansi-tests. Clang seems to fail the ansi-tests WRITE.1,
# PRINT.1, and friends when cr_pow is used.
CONFIG: "x86_linux"
ubuntu:test:
extends: [.unit-test, .ubuntu-needs-build]
ubuntu:ansi-test:
extends: [.ansi-test, .ubuntu-needs-build]
# Optional job that runs the markdown link checker. This is optional
# because it's very slow, of course; you have to run it manually.
#
# From https://github.com/tcort/markdown-link-check
# Checks links on the wiki pages whenever any wiki markdown pages change.
markdown-link-check:
extends: [.optional-rules, .linux]
stage: markdown-link-check
# It's ok if this fails; we don't want to declare the entire
# pipeline as having failed.
allow_failure: true
# This job doesn't depend on any others.
needs: []
script:
# Check links in the main repo
- find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check
# Clone the wiki pages and check the links there. Lots of
# failures here because of
# https://gitlab.com/gitlab-org/gitlab/-/issues/17845.
- git clone https://gitlab.common-lisp.net/cmucl/cmucl.wiki.git
- find cmucl.wiki -name \*.md -print0 | xargs -0 -n1 markdown-link-check