forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 2
513 lines (448 loc) · 20.4 KB
/
root-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
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
name: 'ROOT CI'
on:
# https://github.com/root-project/root/pull/12112#issuecomment-1411004278
pull_request:
branches:
- '**'
paths-ignore:
- 'doc/**'
- 'documentation/**'
push:
branches:
- 'master'
- 'v*-*-*-patches'
# Allows nightly builds to trigger one run for each branch easily, by
# providing the relevant branch as "default" value here:
workflow_call:
inputs:
head_ref:
type: string
default: master
base_ref:
type: string
default: master
ref_name:
type: string
default: master
# Enables manual start of workflow
workflow_dispatch:
inputs:
head_ref:
description: rebase from ...
type: string
required: true
default: master
base_ref:
description: ... to ... (can have same value)
type: string
required: true
default: master
incremental:
description: 'Do incremental build'
type: boolean
required: true
default: true
binaries:
description: Create binary packages and upload them as artifacts
type: boolean
required: true
default: false
buildtype:
description: The CMAKE_BUILD_TYPE to use for non-Windows.
type: choice
options:
- Debug
- RelWithDebInfo
- Release
- MinSizeRel
default: Debug
required: true
env:
PYTHONUNBUFFERED: true
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
OS_AUTH_TYPE: 'v3applicationcredential'
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: 'public'
OS_REGION_NAME: 'cern'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build-macos:
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '[skip-ci]'))
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# Specify platform + arch + (optional) build option overrides
#
# Common configs: {Release,Debug,RelWithDebInfo)
# Build options: https://root.cern/install/build_from_source/#all-build-options
include:
- platform: mac13
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- platform: mac14
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
- platform: mac-beta
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
runs-on: # Using '[self-hosted, ..., ...]' does not work for some reason :)
- self-hosted
- macOS
- ${{ matrix.arch }}
- ${{ matrix.platform }}
name: ${{ matrix.platform }} ${{ matrix.arch }} ${{ join( matrix.overrides, ', ' ) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Apply option overrides from matrix for this job for non-release builds
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }}
env:
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/${{ matrix.platform }}.txt'
shell: bash
run: |
set -x
echo '' >> "$CONFIGFILE"
for ENTRY in $OVERRIDES; do
KEY=$( echo "$ENTRY" | cut -d '=' -f 1 )
# Add entry to file if not exists, otherwise replace
if grep -q "$KEY=" "$CONFIGFILE"; then
sed -i "s/$KEY=.*\$/$ENTRY/" "$CONFIGFILE"
else
echo "$ENTRY" >> "$CONFIGFILE"
fi
done
cat "$CONFIGFILE" || true
- uses: root-project/gcc-problem-matcher-improved@main
with:
build-directory: /Users/sftnight/ROOT-CI/src/
- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--sha ${{ github.sha }}
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
--head_sha ${{ github.event.pull_request.head.sha }}
--repository ${{ github.server_url }}/${{ github.repository }}
--platform ${{ matrix.platform }}"
- name: Workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ inputs.buildtype }}
--platform ${{ matrix.platform }}
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--binaries ${{ inputs.binaries }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Nightly build
if: github.event_name == 'schedule'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype Release
--platform ${{ matrix.platform }}
--incremental false
--binaries true
--base_ref ${{ inputs.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Update build cache after push to release branch
if: github.event_name == 'push'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--platform ${{ matrix.platform }}
--incremental false
--base_ref ${{ github.ref_name }}
--binaries ${{ startsWith(github.ref, 'refs/tags/') }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: Test Results ${{ matrix.platform }} ${{ matrix.arch }}
path: /Users/sftnight/ROOT-CI/build/TestResults.xml
- name: Upload binaries
if: ${{ !cancelled() && (inputs.binaries || github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }}
uses: actions/upload-artifact@v3
with:
name: Binaries ${{ matrix.platform }} ${{ matrix.arch }}
path: /Users/sftnight/ROOT-CI/packages/root_v*
if-no-files-found: error
build-windows:
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '[skip-ci]'))
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# We have to get a bit creative here: GitHub actions only allows to
# exclude partial matches, so we artificially add the event_name as
# a "constant variable" that we can use to remove the Debug entries
# for pull requests and on branch pushes. This is further complicated
# by the fact that event_name is a string, but we need an array. So
# we construct a JSON string that we can then convert into an array.
event_name: ${{ fromJSON(format('["{0}"]', github.event_name)) }}
config: ["Debug", "Release"]
target_arch: [x64, x86]
exclude:
- event_name: pull_request
config: Debug
- event_name: push
config: Debug
name: Windows 10 ${{ matrix.target_arch }} ${{ matrix.config }}
runs-on: # Using '[self-hosted, windows, ${{ matrix.arch }}]' does not work for some reason :)
- self-hosted
- windows
- x64 # machine host, not build target
- target${{ matrix.target_arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--sha ${{ github.sha }}
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
--head_sha ${{ github.event.pull_request.head.sha }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }}"
- name: Workflow dispatch/call
if: github.event_name == 'workflow_dispatch'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--binaries ${{ inputs.binaries }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }}"
- name: Nightly build
if: github.event_name == 'schedule'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental false
--binaries true
--base_ref ${{ inputs.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }}"
- name: Update build cache after push to release branch
if: github.event_name == 'push'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental false
--base_ref ${{ github.ref_name }}
--binaries ${{ startsWith(github.ref, 'refs/tags/') }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }}"
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: Test Results Windows ${{ matrix.target_arch }} ${{ matrix.config }}
path: C:/ROOT-CI/build/TestResults.xml
- name: Upload binaries
if: ${{ !cancelled() && (inputs.binaries || github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }}
uses: actions/upload-artifact@v3
with:
name: Binaries ${{ matrix.target_arch }} ${{ matrix.config }}
path: C:/ROOT-CI/packages/root_v*
if-no-files-found: error
build-linux:
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '[skip-ci]'))
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# Specify image + (optional) build option overrides
#
# Available images: https://github.com/root-project/root-ci-images
# Common configs: {Release,Debug,RelWithDebInfo)
# Build options: https://root.cern/install/build_from_source/#all-build-options
include:
- image: fedora39
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
- image: fedora38
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20", "CMAKE_BUILD_TYPE=Debug"]
- image: alma8
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: alma9
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu20
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: ubuntu22
overrides: ["imt=Off", "LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu2310
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
runs-on:
- self-hosted
- linux
- x64
name: ${{ matrix.image }} ${{ join( matrix.overrides, ', ' ) }}
container:
image: registry.cern.ch/root-ci/${{ matrix.image }}:buildready # ALSO UPDATE BELOW!
options: '--security-opt label=disable --rm' # ALSO UPDATE BELOW!
env:
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
OS_AUTH_TYPE: 'v3applicationcredential'
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: 'public'
OS_REGION_NAME: 'cern'
PYTHONUNBUFFERED: true
steps:
- name: Set up Python Virtual Env
# if the `if` expr is false, `if` still has exit code 0.
# if the `if` block is entered, the block's exit code becomes the exit
# code of the `if`.
run: 'if [ -d /py-venv/ROOT-CI/bin/ ]; then . /py-venv/ROOT-CI/bin/activate && echo PATH=$PATH >> $GITHUB_ENV; fi'
- name: Checkout
uses: actions/checkout@v4
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Print debug info
run: 'printf "%s@%s\\n" "$(whoami)" "$(hostname)";
ls -la
'
- name: Apply option overrides from matrix for this job for non-release builds
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }}
env:
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/${{ matrix.image }}.txt'
shell: bash
run: |
set -x
echo '' >> "$CONFIGFILE"
for ENTRY in $OVERRIDES; do
KEY=$( echo "$ENTRY" | cut -d '=' -f 1 )
# Add entry to file if not exists, otherwise replace
if grep -q "$KEY=" "$CONFIGFILE"; then
sed -i "s/$KEY=.*\$/$ENTRY/" "$CONFIGFILE"
else
echo "$ENTRY" >> "$CONFIGFILE"
fi
done
cat "$CONFIGFILE" || true
- uses: root-project/gcc-problem-matcher-improved@main
with:
build-directory: /github/home/ROOT-CI/src/
- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--platform ${{ matrix.image }}
--image registry.cern.ch/root-ci/${{ matrix.image }}:buildready
--dockeropts '--security-opt label=disable --rm'
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--sha ${{ github.sha }}
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
--head_sha ${{ github.event.pull_request.head.sha }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ inputs.buildtype }}
--platform ${{ matrix.image }}
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--binaries ${{ inputs.binaries }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Nightly build
if: github.event_name == 'schedule'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype Release
--platform ${{ matrix.image }}
--incremental false
--binaries true
--base_ref ${{ inputs.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Update build cache after push to release branch
if: github.event_name == 'push'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--platform ${{ matrix.image }}
--incremental false
--base_ref ${{ github.ref_name }}
--binaries ${{ startsWith(github.ref, 'refs/tags/') }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: Test Results ${{ matrix.image }}
path: /github/home/ROOT-CI/build/TestResults.xml
- name: Upload binaries
if: ${{ !cancelled() && (inputs.binaries || github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }}
uses: actions/upload-artifact@v3
with:
name: Binaries ${{ matrix.image }}
path: /github/home/ROOT-CI/packages/root_v*
if-no-files-found: error
event_file:
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.title, '[skip-ci]'))
name: "Upload Event Payload"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}