forked from lilypond/lilypond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
233 lines (213 loc) · 6.22 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
# This file is part of LilyPond, the GNU music typesetter.
#
# Copyright (C) 2020--2022 Jonas Hahnfeld <hahnjo@hahnjo.de>
#
# LilyPond is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# LilyPond is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
stages:
- build
- test
- documentation
- website
default:
image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-18.04:20210502
interruptible: true
# Conditionally include a file to add the tag 'lilypond' to all jobs so that
# they are assigned to our custom runners, but we can leave the shared runners
# enabled for external contributors forking the repository.
include:
- local: .gitlab-ci.lilypond.yml
rules:
- if: $CI_PROJECT_PATH == "lilypond/lilypond"
.if-default-branch: &if-default-branch
if: $CI_PROJECT_PATH == "lilypond/lilypond" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
.if-mr-to-default: &if-mr-to-default
if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
.if-stable-branch: &if-stable-branch
if: $CI_PROJECT_PATH == "lilypond/lilypond" && $CI_COMMIT_BRANCH =~ /stable\/.*/
.if-schedule-or-web: &if-schedule-or-web
if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
# Source files are checked out freshly for each job. This leads to the situation
# that make considers the artifacts outdated and rebuilds LilyPond from scratch.
# .touch-build contains the command needed to touch the downloaded build files,
# grouped into a pre-collapsed custom section.
.touch-build: &touch-build
- echo -e "section_start:`date +%s`:touch_build[collapsed=true]\r\e[0KTouch build artifacts"
- make -C python --touch all
- make -C scripts --touch all
- make -C flower --touch all
- make -C lily --touch all
- make -C mf --touch all
- echo -e "section_end:`date +%s`:touch_build\r\e[0K"
variables:
CONFIGURE_FLAGS: "--ci"
# Always clone and build in the same directory to avoid problems with
# 'make test-baseline' and 'make check'.
GIT_CLONE_PATH: "/builds/lilypond/lilypond"
# An additional variable not set here but used below is $MAKE_FLAGS. This can
# be set per runner and allows to enable parallel builds. For example, set its
# value to "-j4 CPU_COUNT=4" in order to speed up the build.
build:
stage: build
rules:
- <<: *if-default-branch
- <<: *if-mr-to-default
- <<: *if-stable-branch
- <<: *if-schedule-or-web
script:
- mkdir build && cd build
- ../autogen.sh $CONFIGURE_FLAGS
- make $MAKE_FLAGS
artifacts:
untracked: true
exclude:
- "build/Documentation/out/**"
- "build/out/lybook-db/**"
expire_in: 1 week
build-guile2:
extends: build
image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-18.04.guile2:20220116
rules:
- <<: *if-default-branch
when: manual
allow_failure: true
- <<: *if-mr-to-default
when: manual
allow_failure: true
- <<: *if-schedule-or-web
when: manual
allow_failure: true
test:
stage: test
rules:
- <<: *if-default-branch
when: never
- <<: *if-stable-branch
- <<: *if-schedule-or-web
dependencies: [ "build" ]
script:
- cd build
- *touch-build
- make $MAKE_FLAGS test
artifacts:
when: always
expire_in: 1 week
paths:
- "**/*.fail.log"
test-guile2:
extends: test
image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-18.04.guile2:20220116
rules:
- <<: *if-default-branch
when: manual
allow_failure: true
- <<: *if-schedule-or-web
when: manual
allow_failure: true
dependencies: [ "build-guile2" ]
needs: [ "build-guile2" ]
test-baseline:
stage: test
rules:
- <<: *if-default-branch
dependencies: [ "build" ]
script:
- cd build
- *touch-build
- make $MAKE_FLAGS test-baseline
- tar czf ../test-baseline.tar.gz input/regression/out-test-baseline input/regression/*/out-test-baseline out-baseline
artifacts:
when: always
expire_in: 1 week
paths:
- "test-baseline.tar.gz"
- "**/*.fail.log"
check:
stage: test
rules:
- <<: *if-mr-to-default
dependencies: [ "build" ]
script:
- cd build
- *touch-build
- ../scripts/auxiliar/download-test-baseline.sh
- make $MAKE_FLAGS check
- mv out/test-results/ ..
- echo "Results can be viewed at $CI_JOB_URL/artifacts/file/test-results/index.html"
artifacts:
name: "test-results"
when: always
expire_in: 1 week
paths:
- "test-results/**"
- "**/*.fail.log"
check-guile2:
extends: check
image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-18.04.guile2:20220116
rules:
- <<: *if-mr-to-default
when: manual
allow_failure: true
dependencies: [ "build-guile2" ]
needs: [ "build-guile2" ]
doc:
stage: documentation
rules:
- <<: *if-default-branch
when: never
- <<: *if-mr-to-default
- <<: *if-stable-branch
- <<: *if-schedule-or-web
dependencies: [ "build" ]
script:
- cd build
- *touch-build
- make $MAKE_FLAGS doc
artifacts:
name: "logs"
when: on_failure
expire_in: 1 week
paths:
- "**/*.fail.log"
doc-guile2:
extends: doc
image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-18.04.guile2:20220116
rules:
- <<: *if-default-branch
when: manual
allow_failure: true
- <<: *if-mr-to-default
when: manual
allow_failure: true
- <<: *if-schedule-or-web
when: manual
allow_failure: true
dependencies: [ "build-guile2" ]
needs: [ "build-guile2" ]
website:
stage: website
rules:
- <<: *if-default-branch
when: manual
allow_failure: true
dependencies: [ "build" ]
script:
- cd build
- *touch-build
- make $MAKE_FLAGS website
artifacts:
name: "website"
when: always
expire_in: 1 week
paths:
- "build/out/website-root/**"