forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
329 lines (295 loc) · 9.79 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
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
---
# This CI will only work for project members. CI for public contributors
# runs via a webhook on the merge requests. There's nothing you have to do if
# you want your changes tested -- created pipeline will be automatically
# linked in the merge request and appropriate labels will be added to it.
# Changes to this file will NOT be reflected in the webhook testing.
include:
- project: cki-project/pipeline-definition
ref: production
file: kernel_templates.yml
- project: cki-project/cki-lib
ref: production
file: .gitlab/ci_templates/interruptible.yml
if: $CI_PIPELINE_SOURCE == "merge_request_event"
workflow:
rules:
# ARK release pipelines
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# HEAD pipelines
- if: $CI_PIPELINE_SOURCE =~ /push|web/ &&
$CI_PROJECT_PATH =~ /^cki-project.kernel-ark/
# merge requests
- if: $CI_MERGE_REQUEST_PROJECT_PATH =~ /^cki-project.kernel-ark/
.rules:
only-os-build-mr: &only-os-build-mr
if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "os-build"
when: never
only-os-build-head: &only-os-build-head
if: $CI_COMMIT_BRANCH != "os-build" || $CI_PIPELINE_SOURCE !~ /push|web/
when: never
only-os-build-head-mr: &only-os-build-head-mr
if: ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "os-build") &&
($CI_COMMIT_BRANCH != "os-build" || $CI_PIPELINE_SOURCE !~ /push|web/)
when: never
only-os-build-schedule: &only-os-build-schedule
if: $CI_COMMIT_BRANCH != "os-build" || $CI_PIPELINE_SOURCE != "schedule"
when: never
only-ark-latest-head: &only-ark-latest-head
if: $CI_COMMIT_BRANCH != "ark-latest" || $CI_PIPELINE_SOURCE !~ /push|web/
when: never
on-success: &on-success
when: on_success
manual-on-mr: &manual-on-mr
if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
allow_failure: true
manual-for-bot: &manual-for-bot
if: $CI_COMMIT_AUTHOR =~ /<kernel-team@fedoraproject.org>/
when: manual
allow_failure: true
srpm-for-bot: &srpm-for-bot
if: $CI_COMMIT_AUTHOR =~ /<kernel-team@fedoraproject.org>/
when: on_success
variables:
skip_build: 'true'
skip_publish: 'true'
architectures: ''
.pipeline:
stage: test
trigger:
project: redhat/red-hat-ci-tools/kernel/cki-internal-pipelines/cki-trusted-contributors
strategy: depend
variables:
kernel_type: 'upstream'
srpm_make_target: dist-srpm
.trigger_ark:
extends: .pipeline
trigger:
branch: kernel-ark
variables:
name: kernel-ark
builder_image: quay.io/cki/builder-rawhide
kpet_tree_family: rawhide
kpet_tree_name: rawhide
.trigger_eln:
extends: .pipeline
trigger:
branch: eln
variables:
name: ark-eln
builder_image: quay.io/cki/builder-eln
native_tools: 'true'
kpet_tree_family: eln
kpet_tree_name: eln
disttag_override: '.eln'
.no_tests:
variables:
skip_setup: 'true'
skip_test: 'true'
skip_results: 'true'
.reported_tests:
variables:
report_rules: |
[
{"when": "failed_tests", "send_to": "failed_tests_maintainers"},
{"when": "always", "send_to": "ark-team@redhat.com"}
]
.srpm_for_bot:
rules:
- *only-os-build-mr
- *srpm-for-bot
- *on-success
.manual_for_bot:
rules:
- *only-os-build-mr
- *manual-for-bot
- *on-success
.ark_latest_head:
rules:
- *only-ark-latest-head
- *on-success
.variants:
ark-up: &ark-up
rpmbuild_with: up
package_name: kernel
architectures: x86_64 aarch64 s390x ppc64le
run_redhat_self_test: 'true'
ark-up-debug: &ark-up-debug
rpmbuild_with: up dbgonly
package_name: kernel-debug
architectures: x86_64 aarch64
eln-up: &eln-up
rpmbuild_with: up
package_name: kernel
architectures: x86_64 aarch64 s390x ppc64le
run_redhat_self_test: 'true'
eln-up-debug: &eln-up-debug
rpmbuild_with: up dbgonly
package_name: kernel-debug
architectures: x86_64 aarch64 s390x ppc64le
eln-rt: &eln-rt
rpmbuild_with: realtime
package_name: kernel-rt
architectures: x86_64
eln-rt-debug: &eln-rt-debug
rpmbuild_with: realtime dbgonly
package_name: kernel-rt-debug
architectures: x86_64
eln-64k: &eln-64k
rpmbuild_with: arm64_64k
package_name: kernel-64k
architectures: aarch64
eln-64k-debug: &eln-64k-debug
rpmbuild_with: arm64_64k dbgonly
package_name: kernel-64k-debug
architectures: aarch64
# ARK CI
ark_merge_request:
extends: [.merge_request, .trigger_ark, .no_tests, .srpm_for_bot]
variables: *ark-up
ark_debug_merge_request:
extends: [.merge_request, .trigger_ark, .no_tests, .manual_for_bot]
variables: *ark-up-debug
# ARK baselines
ark_baseline:
extends: [.baseline, .trigger_ark, .reported_tests, .ark_latest_head]
variables: *ark-up
ark_debug_baseline:
extends: [.baseline, .trigger_ark, .reported_tests, .ark_latest_head]
variables: *ark-up-debug
# ELN CI
eln_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .srpm_for_bot]
variables: *eln-up
eln_debug_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .manual_for_bot]
variables: *eln-up-debug
eln_realtime_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .manual_for_bot]
variables: *eln-rt
eln_realtime_debug_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .manual_for_bot]
variables: *eln-rt-debug
eln_64k_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .manual_for_bot]
variables: *eln-64k
eln_64k_debug_merge_request:
extends: [.merge_request, .trigger_eln, .no_tests, .manual_for_bot]
variables: *eln-64k-debug
# ELN baselines
eln_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-up
eln_debug_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-up-debug
eln_realtime_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-rt
eln_realtime_debug_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-rt-debug
eln_64k_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-64k
eln_64k_debug_baseline:
extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head]
variables: *eln-64k-debug
# scheduled job
.scheduled_setup:
image: quay.io/cki/builder-eln:production
variables:
GIT_DEPTH: "0"
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/kernel-ark
before_script:
- echo "fastestmirror=true" >> /etc/dnf/dnf.conf
- dnf -y install python3-gitlab git openssh-clients dnf-utils gnupg2
- git config user.name "Fedora Kernel Team"
- git config user.email "kernel-team@fedoraproject.org"
- echo "$PYTHON_GITLAB_CONFIG" >> ~/.python-gitlab.cfg
# Need SSH since the clone is set up without write access.
- eval $(ssh-agent -s)
- echo "$PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$GITLAB_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git remote add gitlab git@gitlab.com:cki-project/kernel-ark.git
- gpg2 --import "$TORVALDS_GPG_KEY"
- git checkout --track origin/master && git describe
- git checkout --track origin/os-build && git describe
- export PROJECT_ID="$CI_PROJECT_ID"
merge_upstream:
extends: .scheduled_setup
script:
- DIST_PUSH=1 redhat/scripts/ci/ark-update-configs.sh
retry: 2
rules:
- *only-os-build-schedule
- if: $RAWHIDE_RELEASE == "false"
rawhide_release:
extends: .scheduled_setup
script:
- git checkout --track origin/ark-latest && git describe
- git checkout --track origin/ark-infra && git describe
- redhat/scripts/ci/ark-create-release.sh "master" "$CI_PROJECT_ID" || exit_code=$?
- if [ $exit_code -eq 3 ]; then echo "Tag exists, halting" && exit 0; fi;
- if [ $exit_code -ne 0 ]; then echo "Unable to create release tag" && exit 1; fi;
- git push gitlab os-build
# ark-create-release.sh creates a tag for ark-latest to be pushed.
# Make sure the ark-latest branch is checked out.
- git checkout ark-latest
- git push gitlab "$(git describe)"
- git push gitlab ark/*
- git push -f gitlab ark-latest
- git push -f gitlab ark-infra
retry: 2
rules:
- *only-os-build-schedule
- if: $RAWHIDE_RELEASE == "true"
test_makefile:
image: quay.io/fedora/fedora:rawhide
variables:
GIT_DEPTH: "0"
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/kernel-ark
before_script:
- echo "fastestmirror=true" >> /etc/dnf/dnf.conf
- dnf -y install python3-gitlab git openssh-clients dnf-utils gnupg2
# These packages are required for 'make dist-get-buildreqs'
- dnf -y install make rpm-build
- git config user.name "Fedora Kernel Team"
- git config user.email "kernel-team@fedoraproject.org"
script:
- export missing=$(make dist-get-buildreqs | grep "Missing dependencies:" | cut -d":" -f2)
- if [ "$missing" == "" ]; then echo "Missing dependencies should not be null but are empty. Review test log." && exit 1; fi;
- dnf -y install $missing
- export missingafter=$(make dist-get-buildreqs | grep "Missing dependencies:" | cut -d":" -f2)
- if [ "$missingafter" != "" ]; then echo "Missing dependencies should be null but are $missingafter. Review test log." && exit 1; fi;
rules:
- *only-os-build-mr
- *on-success
docs:
image: quay.io/cki/cki-tools:production
script:
- pip install sphinx
- cd redhat/docs/
- make SPHINXOPTS="-W" html
artifacts:
paths:
- redhat/docs/_build/html/
rules:
- *only-os-build-head-mr
- *on-success
pages:
image: quay.io/cki/cki-tools:production
needs: [docs]
script:
- mv redhat/docs/_build/html/ public/
artifacts:
paths:
- public
rules:
- *only-os-build-head-mr
- *manual-on-mr
- *on-success