forked from OpenModelica/OpenModelica
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
877 lines (858 loc) · 28.9 KB
/
Copy pathJenkinsfile
File metadata and controls
877 lines (858 loc) · 28.9 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
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
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
def common
def isPR
def shouldWeBuildAlpine
def shouldWeBuildEnterpriseLinux
def shouldWeBuildFedora
def shouldWeEnableMacOSCMakeBuild
def shouldWeBuildWindows
def shouldWeRunTests
pipeline {
agent none
options {
newContainerPerStage()
// Abort the sibling branches as soon as one of them fails: the build is
// going to be red anyway and the stages that are still running would keep
// the nodes busy for hours.
parallelsAlwaysFailFast()
buildDiscarder(logRotator(daysToKeepStr: "14", artifactNumToKeepStr: "2"))
// This group's Jenkins config takes the priority from BUILD_PRIORITY.
jobGroup jobGroupName: 'OpenModelica', useJobGroup: true
}
environment {
LC_ALL = 'C.UTF-8'
}
parameters {
booleanParam(name: 'BUILD_WINDOWS', defaultValue: false, description: 'Build with Windows using CMake')
booleanParam(name: 'BUILD_ALPINE', defaultValue: false, description: 'Build with Alpine (musl libc) using CMake')
booleanParam(name: 'BUILD_ENTERPRISE_LINUX', defaultValue: false, description: 'Build with Enterprise Linux')
booleanParam(name: 'BUILD_FEDORA', defaultValue: false, description: 'Build with Fedora 44')
booleanParam(name: 'ENABLE_MACOS_CMAKE_BUILD', defaultValue: false, description: 'Enable building omc with CMake on MacOS')
// Read at queue time, before common.groovy is loaded.
string(name: 'BUILD_PRIORITY',
defaultValue: env.CHANGE_ID ? '3' : '5',
description: 'Queue priority, 1 (scheduled first) to 5 (last). Defaults to 3 for pull requests and 5 for branch builds.')
}
// stages are ordered according to execution time; highest time first
// nodes are selected based on a priority (in Jenkins config)
stages {
stage('Environment') {
agent {
node {
label 'linux'
customWorkspace 'ws/OpenModelica'
}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
if (changeRequest()) {
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
common = load("${env.workspace}/.CI/common.groovy")
def buildFlags = common.evaluateBuildFlags()
isPR = buildFlags.isPR
shouldWeBuildAlpine = buildFlags.shouldWeBuildAlpine
shouldWeBuildEnterpriseLinux = buildFlags.shouldWeBuildEnterpriseLinux
shouldWeBuildFedora = buildFlags.shouldWeBuildFedora
shouldWeEnableMacOSCMakeBuild = buildFlags.shouldWeEnableMacOSCMakeBuild
shouldWeBuildWindows = buildFlags.shouldWeBuildWindows
shouldWeRunTests = buildFlags.shouldWeRunTests
}
}
}
stage('setup') {
parallel {
// Linux build stages
stage('jammy-clang') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.buildClangOMC() }
}
}
stage('jammy-gcc') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.buildGccOMC() }
}
}
stage('alpine-clang') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:alpine-3.24'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeBuildAlpine }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.buildOMC([
"-DCMAKE_BUILD_TYPE=Release",
"-DOM_USE_CCACHE=OFF",
"-DCMAKE_INSTALL_PREFIX=build",
"-DCMAKE_C_COMPILER=clang",
"-DCMAKE_CXX_COMPILER=clang++"])
}
}
}
stage('enterprise-linux-gcc') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:almalinux-10'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeBuildEnterpriseLinux }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.withSccache {
common.buildOMC([
"-DCMAKE_BUILD_TYPE=Release",
"-DOM_COMPILER_CACHE=sccache",
"-DCMAKE_INSTALL_PREFIX=build",
"-DCMAKE_C_COMPILER=gcc",
"-DCMAKE_CXX_COMPILER=g++"
])
}
}
}
}
stage('fedora-gcc') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:fedora-44'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeBuildFedora }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.withSccache {
common.buildOMC([
"-DCMAKE_BUILD_TYPE=Release",
"-DOM_COMPILER_CACHE=sccache",
"-DCMAKE_INSTALL_PREFIX=build",
"-DCMAKE_C_COMPILER=gcc",
"-DCMAKE_CXX_COMPILER=g++"])
}
}
}
}
// macOS build stages
stage('macos-arm64-gcc') {
agent {
node {
label 'M1'
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeEnableMacOSCMakeBuild}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.buildOMC([
"-DCMAKE_BUILD_TYPE=Release",
"-DOM_USE_CCACHE=OFF",
"-DCMAKE_INSTALL_PREFIX=build",
"-DCMAKE_PREFIX_PATH=/opt/homebrew", // Prefer the Homebrew libraries over others in the system.
"-DCMAKE_C_COMPILER=gcc", // Always specify the compilers explicitly for macOS
"-DCMAKE_CXX_COMPILER=g++",
"-DCMAKE_Fortran_COMPILER=gfortran",
"-DOM_OMC_ENABLE_COLPACK=OFF"]) // Disable ColPack (missing OpenMP)
}
}
}
// Windows build stages
stage('OMDev-gcc') {
agent {
node {
label 'windows-no-release'
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeBuildWindows}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.buildOMC([
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_INSTALL_PREFIX=build',
'-G "MSYS Makefiles"'])
}
}
}
// The Rust (mmtorust) omc port, GUI off; the GUI is built in parallel
// with the tests by the 'build-gui-rust' stage. See common.buildRustOMC().
stage('rust-cmake') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust'
label 'linux && !slow'
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=rust-sccache,target=/cache/sccache " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
"-v /var/lib/jenkins/MacOSX.sdk:/mnt/MacOSX.sdk:ro " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
steps {
script {
common.buildRustOMC()
}
}
}
// Checks
stage('checks') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.checks() }
}
}
}
}
stage('tests + extras') {
parallel {
// The only shard that runs the coverage-instrumented CMake build: its
// counters become the coverage report in 'check-and-upload'. The clang
// shard below runs an uninstrumented build and records none.
stage('04 testsuite-gcc 1/2') {
agent {
node {
label 'linux && !slow'
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.insideTestImage('docker.openmodelica.org/build-deps:ubuntu-22.04',
common.testCacheMounts('runtest-gcc-cache')) {
common.ctestStashed('omc-gcc', 1, 2)
}
}
}
}
stage('05 testsuite-clang 2/2') {
agent {
node {
label 'linux && !slow'
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.insideTestImage('docker.openmodelica.org/build-deps:ubuntu-22.04',
common.testCacheMounts('runtest-clang-cache')) {
common.partestStashed('omc-clang', 2, 2)
}
}
}
}
// The WebAssembly/web bundle, embedding the wasm-jit runtime built by
// the rust-clang stage (OM_OMC_WASM forces the Rust port and a
// wasm32 build of just the browser/Node deliverable).
stage('10 web target') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust-qt-wasm'
label 'linux'
// EM_CACHE on a persistent volume so the Qt-wasm sysroot (libc/libc++
// and the ASYNCIFY/memory-growth variants) is built once, not per run.
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=rust-sccache,target=/cache/sccache " +
"--mount type=volume,source=emscripten-cache,target=/cache/emscripten " +
"-e EM_CACHE=/cache/emscripten " +
"-v /var/lib/jenkins/MacOSX.sdk:/mnt/MacOSX.sdk:ro " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
common.buildRustWeb()
}
}
}
// The slow Qt web pages (OMShell/OMNotebook/OMEdit-qt), in parallel;
// merged by upload-web.
stage('10b qt-web target') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust-qt-wasm'
label 'linux&&!slow'
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=rust-sccache,target=/cache/sccache " +
"--mount type=volume,source=emscripten-cache,target=/cache/emscripten " +
"-e EM_CACHE=/cache/emscripten " +
"-v /var/lib/jenkins/MacOSX.sdk:/mnt/MacOSX.sdk:ro " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
common.buildRustWebQt()
}
}
}
// Qt GUI clients linked against the stage-1 cdylib (no cargo/codegen
// rerun), in parallel with the tests. See common.buildRustGUI().
stage('11 build-gui-rust') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust'
label 'linux'
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=rust-sccache,target=/cache/sccache " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
common.buildRustGUI()
}
}
}
// Cargo workspace unit tests (dev/cranelift) off the build critical path,
// on the stage-1 generated .rs. See common.ctestRust().
stage('12 unit-tests-rust') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust'
label 'linux'
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=rust-sccache,target=/cache/sccache " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
common.ctestRust()
}
}
}
stage('13 cross-build-fmu') {
agent {
node {
label 'linux'
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
HOME = "${env.WORKSPACE}/libraries"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.crossBuildFMU() }
}
}
// The Rust omc with the wasm-jit target: no C compiler or linker per
// model, which is where the ~1000 runs went. The rust image because that
// is the glibc the unstashed omc was built against.
stage('14 testsuite-compliance') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust'
label 'linux'
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
environment {
LIBRARIES = "/cache/omlibrary"
COMPLIANCEEXTRAFLAGS = "--simCodeTarget=wasm-jit"
COMPLIANCEEXTRAREPORTFLAGS = "--expectedFailures=.CI/compliance.failures --flakyTests=.CI/compliance.flaky"
COMPLIANCEPREFIX = "compliance"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.compliance() }
}
}
stage('15 build-usersguide') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
args '''
--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary \
-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache
'''
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/" // Dummy directory
LIBRARIES = "/cache/omlibrary"
GITHUB_AUTH = credentials('OpenModelica-Hudson')
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.buildUsersGuide() }
}
}
stage('17 build-gui-clang + omedit-testsuite') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
args "--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
customWorkspace 'ws/OpenModelica'
}
}
environment {
// makeLibsAndCache() only reads runtest.db from RUNTESTDB (and
// tolerates it being absent); the omlibrary cache is the one that
// matters here, so no runtest volume is mounted.
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.buildGUIAndRunOMEditTestsuite() }
}
}
// parmod, the Matlab translator, the icon generator and the C unit tests.
// Short runs sharing one image, so one node: split up, the
// image pull and the git checkout cost more than the tests.
stage('18 testsuite-misc') {
agent {
node {
// Intel only: ParModelica compiles its OpenCL kernels through the node's ICD,
// which on AMD is PoCL. Jammy's PoCL 1.8 (LLVM 14) cannot name a Zen CPU it
// does not know and falls back to the target CPU 'generic', which LLVM
// rejects; the POCL_LLVM_CPU_NAME override only exists in later PoCL. Lifting
// this needs both the build and the tests on a newer image (Ubunut 26.04 or newer).
label 'linux-intel-x64'
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.insideTestImage('docker.openmodelica.org/build-deps:ubuntu-22.04',
common.testCacheMounts('runtest-clang-icon-generator')) {
common.testMisc()
}
}
}
post {
always {
junit testResults: 'build_cmake/junit.xml', skipPublishingChecks: true
}
}
}
// The wasm-jit partest against the Rust-built omc; dedicated runtest
// cache. See common.partestRust(). Last in the block (against the
// ordering rule above): the fastest of the testsuite runs, so it loses
// the least by starting after the others. Unpartitioned - it is fast
// enough not to need the split the C targets use.
stage('19 testsuite-wasm-jit') {
agent {
node {
label 'linux && !slow'
customWorkspace 'ws/OpenModelica'
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.insideTestImage('docker.openmodelica.org/build-deps:ubuntu-26.04-rust',
common.testCacheMounts('runtest-rust-cache')) {
common.partestRust('wasm-jit', 1, 1)
}
}
}
}
// The smoke set (every test in '// suite: smoke', see
// testsuite/runWindowsTests.sh), against the install tree
// 'OMDev-gcc' stashed as 'omc-windows'. Its own stage, not
// part of that build, so a test failure here reads as a testsuite
// failure rather than a build failure.
stage('20 testsuite-windows') {
agent {
node {
label 'windows-no-release'
}
}
when {
beforeAgent true
expression { shouldWeBuildWindows }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script {
common.testWindowsSmoke()
}
}
}
// The C omc cross-compiled to Windows (MSVC) from the C sources
// 'cmake-jammy-gcc' translated, and the Windows smoke set run against
// it under wine. See common.crossBuildOMCWindows().
stage('21 cross-build-omc-msvc') {
agent {
docker {
alwaysPull true
image 'docker.openmodelica.org/build-deps:ubuntu-26.04-rust-qt-win-x86_64'
label 'linux'
args "--mount type=volume,source=rust-cargo-registry,target=/opt/rust/cargo/registry " +
"--mount type=volume,source=om-thirdparty-downloads,target=/cache/thirdparty " +
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
common.crossBuildOMCWindows()
}
}
}
}
}
stage('check-and-upload') {
parallel {
stage('linux-FMPy') {
agent {
docker {
label 'linux'
image 'docker.openmodelica.org/build-deps:ubuntu-24.04'
alwaysPull true
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
options {
skipDefaultCheckout true
}
steps {
script { common.fmpyLinux() }
}
}
// Turns the coverage counters of the testsuite-gcc shard into a
// report. Unlike the uploads it is not gated on !isPR: the point is to
// get the number on every PR.
stage('coverage-report') {
agent {
node {
label 'linux'
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { shouldWeRunTests }
}
steps {
script {
// Enters the build image itself: which mounts it needs depends
// on where the instrumented build ran, which it only learns
// from the stash.
common.coverageReportStage(1)
}
}
}
stage('upload-compliance') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { !isPR }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.uploadCompliance() }
}
}
stage('upload-doc') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
expression { !isPR }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.uploadDoc() }
}
}
stage('upload-web') {
agent {
docker {
image 'docker.openmodelica.org/build-deps:ubuntu-22.04'
label 'linux'
alwaysPull true
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
branch 'master'
expression { shouldWeRunTests }
}
steps {
script { common.uploadWeb() }
}
}
}
}
stage('publish') {
parallel {
stage('push-to-master') {
agent {
node {
label 'linux'
customWorkspace 'ws/OpenModelica'
}
}
when {
beforeAgent true
branch 'omlib-staging'
expression { return currentBuild.currentResult == 'SUCCESS' }
}
options {
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.pushToMaster() }
}
}
stage('push-bibliography') {
agent {
node {
label 'linux'
customWorkspace 'ws/OpenModelica-Bibliography'
}
}
when {
beforeAgent true
branch 'master'
expression { return currentBuild.currentResult == 'SUCCESS' }
}
options {
skipDefaultCheckout true
retry(count: 2, conditions: [nonresumable()])
}
steps {
script { common.pushBibliography() }
}
}
}
}
}
post {
failure {
script {
common.notifyOnFailure()
}
}
}
}
/* Note: If getting "Unexpected end of /proc/mounts line" , flatten the docker image:
* https://stackoverflow.com/questions/46138549/docker-openmpi-and-unexpected-end-of-proc-mounts-line
* Or use a newer OS image with fixed hwloc.
*/