forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 1
753 lines (742 loc) · 34 KB
/
base.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
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
name: Mandrel-Quarkus tests
on:
workflow_call:
inputs:
quarkus-version:
type: string
description: 'Quarkus version to test (branch, tag, commit, or "latest")'
# "latest" is replaced by the latest release available in maven
default: "main"
quarkus-repo:
type: string
description: 'The Quarkus repository to be used'
default: 'quarkusio/quarkus'
repo:
type: string
description: 'The Mandrel/Graal repository to be used'
default: 'graalvm/mandrel'
version:
type: string
description: 'Mandrel version to test (branch, tag, or commit)'
default: "graal/master"
mandrel-packaging-version:
type: string
description: 'Mandrel packaging version to test (branch, tag, or commit)'
default: "master"
mandrel-packaging-repo:
type: string
description: 'Mandrel packaging repository to be used'
default: "graalvm/mandrel-packaging"
build-type:
type: string
description: 'Build distribution (Mandrel/GraalVM) from source or grab a release, and control of maven should deploy locally'
default: "mandrel-source"
jdk:
type: string
description: 'OpenJDK to use. One of <feature-version>/ga, <feature-version>/ea, e.g. 17/ga or 17/ea (/ga and /ea suffixes are only relevant when building from source)'
default: "17/ga"
builder-image:
type: string
description: 'The builder image to use instead of a release or building from source (e.g. quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11)'
default: "null"
issue-number:
type: string
description: 'The issue number to report results to'
default: "null"
issue-repo:
type: string
description: 'The repository to report results to'
default: "graalvm/mandrel"
mandrel-it-issue-number:
type: string
description: 'The issue number to report results to mandrel-integration-tests'
default: "null"
build-stats-tag:
type: string
description: 'The tag to use for build stats upload of native tests (e.g. 22.3.0-dev-jdk17-mytest-patch-before)'
default: "null"
secrets:
ISSUE_BOT_TOKEN:
description: 'A token used to report results in GH issues'
required: false
UPLOAD_COLLECTOR_TOKEN:
description: 'A token used to report build statistics to a collector'
required: false
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_NAME: hibernate_orm_test
NATIVE_TEST_MAVEN_OPTS: "--fail-at-end -Dtest-containers -Dstart-containers -DfailIfNoTests=false -Dquarkus.native.native-image-xmx=13g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs"
MX_GIT_CACHE: refcache
JAVA_HOME: ${{ github.workspace }}/openjdk
GRAALVM_HOME: ${{ github.workspace }}/graalvm-home
MANDREL_REPO: ${{ github.workspace }}/mandrel
MANDREL_HOME: ${{ github.workspace }}/../mandrelvm
MX_PATH: ${{ github.workspace }}/mx
MX_PYTHON: python
QUARKUS_PATH: ${{ github.workspace }}/quarkus
MANDREL_IT_PATH: ${{ github.workspace }}/mandrel-integration-tests
MANDREL_PACKAGING_REPO: ${{ github.workspace }}/mandrel-packaging
COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats
jobs:
build-vars:
name: Set distribution, build-from-source, and maven-deploy-local variables based on build-type
runs-on: ubuntu-latest
outputs:
build-from-source: ${{ steps.source-build.outputs.build-from-source }}
distribution: ${{ steps.distro.outputs.distribution }}
maven-deploy-local: ${{ steps.maven-deploy-local.outputs.maven-deploy-local }}
steps:
- name: Set build-from-source output
id: source-build
run: |
echo "${{ inputs.build-type }}"
bfs_token=$(echo ${{ inputs.build-type }} | cut -d'-' -f2)
if [ "${bfs_token}" == "release" ]
then
source_build=false
elif [ "${bfs_token}" == "source" ]
then
source_build=true
else
echo "Unexpected input 'build-type' = ${{ inputs.build-type }}"
exit 1
fi
echo "source_build=$source_build"
echo "build-from-source=$source_build" >> $GITHUB_OUTPUT
- name: Set distribution output
id: distro
run: |
bfs_token=$(echo ${{ inputs.build-type }} | cut -d'-' -f1)
if [ "${bfs_token}" == "graal" ]
then
distro="graalvm"
elif [ "${bfs_token}" == "mandrel" ]
then
distro="mandrel"
else
echo "Unexpected input 'build-type' = ${{ inputs.build-type }}"
exit 1
fi
echo "distro=$distro"
echo "distribution=$distro" >> $GITHUB_OUTPUT
- name: Set maven-deploy-local output
id: maven-deploy-local
run: |
bfs_token=$(echo ${{ inputs.build-type }} | cut -d'-' -f3)
if [ "${bfs_token}" == "nolocalmvn" ]
then
maven_deploy_local=""
else
maven_deploy_local="--maven-deploy-local"
fi
echo "maven_deploy_local=$maven_deploy_local"
echo "maven-deploy-local=$maven_deploy_local" >> $GITHUB_OUTPUT
get-test-matrix:
name: Get test matrix
runs-on: ubuntu-latest
outputs:
quarkus-version: ${{ steps.version.outputs.quarkus-version }}
tests-matrix: ${{ steps.version.outputs.tests-matrix }}
artifacts-suffix: ${{ steps.suffix.outputs.suffix }}
steps:
- id: suffix
run: |
export SUFFIX=$(echo '${{ toJson(inputs) }}' | jq -j '. | to_entries[] | "-\(.value)"' | tr '":<>|*?\r\n\/' '-')
echo $SUFFIX
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
- name: Get Quarkus version and test matrix
id: version
run: |
if [ ${{ inputs.quarkus-version }} == "latest" ]
then
export QUARKUS_VERSION=$(curl -s https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/Final/ {print $3}' | sort -V | tail -n 1)
elif $(expr match "${{ inputs.quarkus-version }}" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
else
export QUARKUS_VERSION=$(git ls-remote ${GITHUB_SERVER_URL}/${{ inputs.quarkus-repo }} | grep "refs/heads/${{ inputs.quarkus-version }}$\|refs/tags/${{ inputs.quarkus-version }}$" | cut -f 1)
fi
if [ "$QUARKUS_VERSION" == "" ]
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
fi
echo ${QUARKUS_VERSION}
echo "quarkus-version=${QUARKUS_VERSION}" >> $GITHUB_OUTPUT
curl --output native-tests.json https://raw.githubusercontent.com/${{ inputs.quarkus-repo }}/${QUARKUS_VERSION}/.github/native-tests.json
tests_json=$(tr -d '\n' < native-tests.json)
echo ${tests_json}
echo "tests-matrix=${tests_json}" >> $GITHUB_OUTPUT
build-mandrel:
name: Mandrel build
runs-on: ubuntu-latest
needs:
- get-test-matrix
- build-vars
steps:
- uses: actions/checkout@v4
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
with:
repository: ${{ inputs.repo }}
fetch-depth: 1
ref: ${{ inputs.version }}
path: ${{ env.MANDREL_REPO }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Checkout MX
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
run: |
VERSION=$(jq -r .mx_version ${MANDREL_REPO}/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} ${MX_PATH}
./mx/mx --version
- uses: actions/checkout@v4
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
with:
repository: ${{ inputs.mandrel-packaging-repo }}
ref: ${{ inputs.mandrel-packaging-version }}
path: ${{ env.MANDREL_PACKAGING_REPO }}
- uses: actions/cache@v4
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get OpenJDK with static libs
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
run: |
curl -sL https://api.adoptium.net/v3/binary/latest/${{ inputs.jdk }}/linux/x64/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/${{ inputs.jdk }}/linux/x64/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
mkdir -p ${JAVA_HOME}
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
tar xf jdk-static-libs.tar.gz -C ${JAVA_HOME} --strip-components=1
echo ${JAVA_HOME}
${JAVA_HOME}/bin/java --version
- name: Build Mandrel
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
run: |
MVN_LOCAL="${{needs.build-vars.outputs.maven-deploy-local}}"
if [ "$MVN_LOCAL" != "" ]
then
rm -rf ~/.m2/repository/org/graalvm
fi
cd ${MANDREL_PACKAGING_REPO}
${JAVA_HOME}/bin/java -ea build.java \
--mx-home ${MX_PATH} \
--mandrel-repo ${MANDREL_REPO} \
--mandrel-home ${MANDREL_HOME} \
--archive-suffix tar.gz \
"${{needs.build-vars.outputs.maven-deploy-local}}"
${MANDREL_HOME}/bin/native-image --version
mv mandrel-java*-linux-amd64-*.tar.gz ${{ github.workspace }}/jdk.tgz
if [ "$MVN_LOCAL" != "" ]
then
rm -rf graalvm-maven-artefacts.tgz && tar -czvf graalvm-maven-artefacts.tgz -C ~ .m2/repository/org/graalvm
mv graalvm-maven-artefacts.tgz ${{ github.workspace }}
rm -rf graalvm-version.tgz && tar -czvf graalvm-version.tgz -C $(dirname ${MANDREL_HOME}) $(basename ${MANDREL_HOME})/.maven-version
mv graalvm-version.tgz ${{ github.workspace }}
fi
- name: Persist Mandrel build
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
uses: actions/upload-artifact@v4
with:
name: jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
- name: Persist local maven repository
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/upload-artifact@v4
with:
name: org-graalvm-artefacts-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: graalvm-maven-artefacts.tgz
- name: Persist GraalVM maven version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/upload-artifact@v4
with:
name: mandrel-maven-version-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: graalvm-version.tgz
build-graal:
name: GraalVM CE build
runs-on: ubuntu-latest
needs:
- get-test-matrix
- build-vars
steps:
- uses: actions/checkout@v4
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
with:
repository: ${{ inputs.repo }}
fetch-depth: 1
ref: ${{ inputs.version }}
path: graal
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Checkout MX
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
run: |
VERSION=$(jq -r .mx_version graal/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} ${MX_PATH}
./mx/mx --version
- uses: actions/cache@v4
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get labs OpenJDK
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
run: |
cd graal
mkdir jdk-dl
${MX_PATH}/mx --java-home= fetch-jdk --java-distribution labsjdk-ce-$(echo ${{ inputs.jdk }} | cut -d / -f 1) --to `pwd`/jdk-dl --alias ${JAVA_HOME}
${JAVA_HOME}/bin/java --version
- name: Build graalvm native-image
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
run: |
MVN_LOCAL="${{needs.build-vars.outputs.maven-deploy-local}}"
if [ "$MVN_LOCAL" != "" ]
then
rm -rf ~/.m2/repository/org/graalvm
fi
cd graal/substratevm
${MX_PATH}/mx --native=native-image,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent --components="Native Image,LibGraal,svml" build
mv $(${MX_PATH}/mx --native=native-image,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent --components="Native Image,LibGraal,svml" graalvm-home) ${MANDREL_HOME}
${MANDREL_HOME}/bin/native-image --version
if [ "$MVN_LOCAL" != "" ]
then
cd ../
# Deploy maven artefacts to local repository
${MX_PATH}/mx --primary-suite-path sdk maven-deploy --suppress-javadoc 2>&1 | tee maven_deploy.log
rm -rf graalvm-maven-artefacts.tgz && tar -czvf graalvm-maven-artefacts.tgz -C ~ .m2/repository/org/graalvm
mv graalvm-maven-artefacts.tgz ${{ github.workspace }}
# Get version from first line of the log, which should look like "Installing sdk distributions for version 23.1.0.0"
MAVEN_VERS=$(awk 'NR==1 {print $6}' maven_deploy.log)
echo "GraalVM maven version is: ${MAVEN_VERS}"
echo ${MAVEN_VERS} > ${MANDREL_HOME}/.maven-version
rm -rf graalvm-version.tgz && tar -czvf graalvm-version.tgz -C $(dirname ${MANDREL_HOME}) $(basename ${MANDREL_HOME})/.maven-version
mv graalvm-version.tgz ${{ github.workspace }}
fi
- name: Tar GraalVM
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
run: tar czvf jdk.tgz -C $(dirname ${MANDREL_HOME}) $(basename ${MANDREL_HOME})
- name: Persist GraalVM build
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
uses: actions/upload-artifact@v4
with:
name: jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
- name: Persist local maven repository
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/upload-artifact@v4
with:
name: org-graalvm-artefacts-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: graalvm-maven-artefacts.tgz
- name: Persist GraalVM maven version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/upload-artifact@v4
with:
name: mandrel-maven-version-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: graalvm-version.tgz
get-jdk:
name: Get JDK ${{ inputs.jdk }}
runs-on: ubuntu-latest
needs:
- get-test-matrix
- build-vars
steps:
- name: Get Mandrel ${{ inputs.version }}
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == false && needs.build-vars.outputs.distribution == 'mandrel' && inputs.builder-image == 'null'}}
run: |
VERSION=${{ inputs.version }}
curl \
-sL ${GITHUB_SERVER_URL}/graalvm/mandrel/releases/download/${VERSION}/mandrel-java$(echo ${{ inputs.jdk }} | cut -d / -f 1)-linux-amd64-${VERSION##mandrel-}.tar.gz \
-o jdk.tgz
- name: Get GraalVM CE ${{ inputs.version }}
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == false && needs.build-vars.outputs.distribution == 'graalvm' && inputs.builder-image == 'null'}}
run: |
VERSION=${{ inputs.version }}
curl \
-sL ${GITHUB_SERVER_URL}/graalvm/graalvm-ce-builds/releases/download/${VERSION}/graalvm-ce-java$(echo ${{ inputs.jdk }} | cut -d / -f 1)-linux-amd64-${VERSION##vm-}.tar.gz \
-o graalvm.tgz
mkdir -p ${JAVA_HOME}
tar xzvf graalvm.tgz -C ${JAVA_HOME} --strip-components=1
${JAVA_HOME}/bin/gu install native-image
${JAVA_HOME}/bin/native-image --version
tar czvf jdk.tgz -C $(dirname ${JAVA_HOME}) $(basename ${JAVA_HOME})
- name: Persist Mandrel or GraalVM
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == false }}
uses: actions/upload-artifact@v4
with:
name: jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
build-quarkus:
name: Quarkus build
runs-on: ubuntu-latest
needs:
- get-test-matrix
- build-mandrel
- build-graal
- build-vars
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- uses: actions/checkout@v4
with:
repository: ${{ inputs.quarkus-repo }}
fetch-depth: 1
ref: ${{ needs.get-test-matrix.outputs.quarkus-version }}
path: ${{ env.QUARKUS_PATH }}
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ needs.get-test-matrix.outputs.quarkus-version }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-${{ needs.get-test-matrix.outputs.quarkus-version }}-maven-
- name: Change quarkus.version for Quarkus 2.2 to make mandrel-integration-test not apply quarkus_main.patch
# See https://github.com/Karm/mandrel-integration-tests/pull/64
run: |
if [ "${{ inputs.quarkus-version }}" == "2.2" ]
then
cd quarkus
bash ../workflow-mandrel/.github/update_quarkus_version.sh 2.2.999
fi
# Use Java 17 to build Quarkus as that's the lowest supported JDK version currently
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Download GraalVM Maven Repo
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/download-artifact@v4
with:
name: org-graalvm-artefacts-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Download GraalVM Maven Version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
uses: actions/download-artifact@v4
with:
name: mandrel-maven-version-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract GraalVM Maven Repo and GraalVM Maven Version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
shell: bash
run: |
tar -xzvf graalvm-maven-artefacts.tgz -C ~
tar -xzvf graalvm-version.tgz -C $(dirname ${MANDREL_HOME})
- name: Build quarkus with local graalvm version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
run: |
rm -f maven_graalvm_before_build.txt maven_graalvm_after_build.txt
find ~/.m2/repository/org/graalvm | sort > maven_graalvm_before_build.txt
GRAAL_MVN_ARTIFACTS_VERS=$(cat ${MANDREL_HOME}/.maven-version)
echo "Building quarkus with locally installed GraalVM maven artefacts in version: ${GRAAL_MVN_ARTIFACTS_VERS}"
cd ${QUARKUS_PATH}
./mvnw -e -B --settings ${QUARKUS_PATH}/.github/mvn-settings.xml -Dquickly -Dgraal-sdk.version="${GRAAL_MVN_ARTIFACTS_VERS}"
cd -
find ~/.m2/repository/org/graalvm | sort > maven_graalvm_after_build.txt
diff -u maven_graalvm_before_build.txt maven_graalvm_after_build.txt
- name: Build quarkus with default graalvm version
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == false || inputs.builder-image != 'null' || needs.build-vars.outputs.maven-deploy-local == ''}}
run: |
cd ${QUARKUS_PATH}
./mvnw -e -B --settings ${QUARKUS_PATH}/.github/mvn-settings.xml -Dquickly
cd -
- name: Tar Maven Repo
shell: bash
run: |
tar -czvf maven-repo.tgz -C ~ .m2/repository
- name: Persist Maven Repo
uses: actions/upload-artifact@v4
with:
name: maven-repo-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: maven-repo.tgz
- name: Delete Local Quarkus Artifacts From Cache
shell: bash
run: |
rm -r ~/.m2/repository/io/quarkus
- name: Delete Local GraalVM Artifacts From Cache
if: ${{ fromJson(needs.build-vars.outputs.build-from-source) == true && inputs.builder-image == 'null' && needs.build-vars.outputs.maven-deploy-local != ''}}
shell: bash
run: |
rm -rf ~/.m2/repository/org/graalvm
native-tests:
name: Q IT ${{ matrix.category }}
needs:
- build-mandrel
- build-graal
- get-jdk
- build-quarkus
- get-test-matrix
runs-on: ubuntu-latest
env:
# leave more space for the actual native compilation and execution
MAVEN_OPTS: -Xmx1g
# USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM: false
# Ignore the following YAML Schema error
timeout-minutes: ${{matrix.timeout}}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }}
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- name: Download Maven Repo
if: "!startsWith(matrix.os-name, 'windows')"
uses: actions/download-artifact@v4
with:
name: maven-repo-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Maven Repo
if: "!startsWith(matrix.os-name, 'windows')"
shell: bash
run: tar -xzvf maven-repo.tgz -C ~
# Use Java 17 for Quarkus as it doesn't work with Java 21 yet
- uses: actions/setup-java@v4
if: "!startsWith(matrix.os-name, 'windows')"
with:
distribution: 'temurin'
java-version: '17'
- name: Download Mandrel or GraalVM
if: "!startsWith(matrix.os-name, 'windows') && inputs.builder-image == 'null'"
uses: actions/download-artifact@v4
with:
name: jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Mandrel or GraalVM
if: "!startsWith(matrix.os-name, 'windows') && inputs.builder-image == 'null'"
shell: bash
run: |
mkdir -p ${GRAALVM_HOME}
tar -xzvf jdk.tgz -C ${GRAALVM_HOME} --strip-components=1
- uses: actions/checkout@v4
if: "!startsWith(matrix.os-name, 'windows')"
with:
repository: ${{ inputs.quarkus-repo }}
fetch-depth: 1
ref: ${{ needs.get-test-matrix.outputs.quarkus-version }}
path: ${{ env.QUARKUS_PATH }}
- name: Reclaim disk space
if: "!startsWith(matrix.os-name, 'windows')"
run: ${QUARKUS_PATH}/.github/ci-prerequisites.sh
- name: Update Docker Client User Agent
if: "!startsWith(matrix.os-name, 'windows')"
shell: bash
run: |
if [ -f ~/.docker/config.json ]; then
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Mandrel-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json.new
mv ~/.docker/config.json.new ~/.docker/config.json
fi
- name: Change quarkus.version for Quarkus 2.2 to make mandrel-integration-test not apply quarkus_main.patch
if: "!startsWith(matrix.os-name, 'windows')"
# See https://github.com/Karm/mandrel-integration-tests/pull/64
run: |
if [ "${{ inputs.quarkus-version }}" == "2.2" ]
then
cd quarkus
bash ../workflow-mandrel/.github/update_quarkus_version.sh 2.2.999
fi
- name: Build with Maven
if: "!startsWith(matrix.os-name, 'windows')"
env:
TEST_MODULES: ${{matrix.test-modules}}
CATEGORY: ${{matrix.category}}
shell: bash
run: |
cd ${QUARKUS_PATH}
if [[ ${{ inputs.builder-image }} == "null" ]]
then
export BUILDER_IMAGE="-Dquarkus.native.container-build=false"
${GRAALVM_HOME}/bin/native-image --version
else
export BUILDER_IMAGE="-Dquarkus.native.container-build=true -Dquarkus.native.builder-image=${{ inputs.builder-image }}"
fi
# Patch Gradle config to look for GraalVM dependencies in maven local repository
for i in `grep -rl includeGroupByRegex .`
do
sed -i "s/\(^ *includeGroupByRegex\)\( 'io.quarkus.*'\)/\1\2\n\1 'org.graalvm.*'/g" $i
done
# Backwards compatibility with Quarkus < 2.x native-tests.json
if ! echo $TEST_MODULES | grep ',' > /dev/null
then
for i in $TEST_MODULES
do modules+=("$i"); done
IFS=,
TEST_MODULES="${modules[*]}"
# add the 'simple with spaces' project to the run of 'Misc1' by executing it explicitly
# done because there is no good way to pass strings with empty values to the previous command
# so this hack is as good as any
if [ "$CATEGORY" == "Misc1" ]; then
TEST_MODULES="$TEST_MODULES,simple with space"
fi
unset IFS
fi
if [[ $TEST_MODULES == "main" ]]
then
# Build main module with constraint memory to ensure we can build apps on smaller machines too
export NEW_MAX_HEAP_SIZE=-Dquarkus.native.native-image-xmx=5g
fi
./mvnw -B --settings ${QUARKUS_PATH}/.github/mvn-settings.xml -f integration-tests -pl "$TEST_MODULES" -amd $BUILDER_IMAGE $NATIVE_TEST_MAVEN_OPTS $NEW_MAX_HEAP_SIZE
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' | tar czvf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports-native-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'test-reports.tgz'
- name: Collect build JSON stats
if: ${{ always() && inputs.build-stats-tag != 'null' }}
shell: bash
run: find . -name '*runner*.json' | tar czvf build-stats.tgz -T -
- name: Upload build JSON stats
if: ${{ always() && inputs.build-stats-tag != 'null' }}
uses: actions/upload-artifact@v4
with:
name: build-stats-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'build-stats.tgz'
native-tests-stats-upload:
name: Upload build stats to collector
if: ${{ always() && inputs.build-stats-tag != 'null' && github.event_name != 'pull_request' && needs.native-tests.result != 'skipped' && needs.native-tests.result != 'cancelled' }}
needs:
- native-tests
- get-test-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- uses: actions/download-artifact@v4
with:
name: build-stats-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract and import build stats
env:
UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }}
shell: bash
run: |
tar -xf build-stats.tgz
export BUILD_STATS_TAG="$(echo ${{ inputs.build-stats-tag }})"
echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'"
DIR=quarkus/ TAG="${BUILD_STATS_TAG}" TOKEN="${UPLOAD_TOKEN}" URL="${COLLECTOR_URL}" bash workflow-mandrel/.github/import_stats.sh
mandrel-integration-tests:
name: Q Mandrel IT
if: ${{ needs.build-vars.outputs.distribution == 'mandrel' }}
needs:
- build-vars
- build-mandrel
- get-jdk
- build-quarkus
- get-test-matrix
runs-on: ubuntu-latest
env:
# leave more space for the actual native compilation and execution
MAVEN_OPTS: -Xmx1g
# Don't perform performance checks since GH runners are not that stable
FAIL_ON_PERF_REGRESSION: false
# USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM: false
timeout-minutes: 80
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- uses: actions/checkout@v4
with:
repository: Karm/mandrel-integration-tests
fetch-depth: 1
path: ${{ env.MANDREL_IT_PATH }}
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
name: maven-repo-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Maven Repo
run: tar -xzvf maven-repo.tgz -C ~
# Use Java 17 for Quarkus as it doesn't work with Java 21 yet
- uses: actions/setup-java@v4
if: "!startsWith(matrix.os-name, 'windows')"
with:
distribution: 'temurin'
java-version: '17'
- name: Download Mandrel or GraalVM
if: "!startsWith(matrix.os-name, 'windows') && inputs.builder-image == 'null'"
uses: actions/download-artifact@v4
with:
name: jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Mandrel or GraalVM
if: "!startsWith(matrix.os-name, 'windows') && inputs.builder-image == 'null'"
shell: bash
run: |
mkdir -p ${GRAALVM_HOME}
tar -xzvf jdk.tgz -C ${GRAALVM_HOME} --strip-components=1
- name: Update Docker Client User Agent
run: |
if [ -f ~/.docker/config.json ]; then
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Mandrel-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json.new
mv ~/.docker/config.json.new ~/.docker/config.json
fi
- name: Install gdb
run: |
sudo apt-get update -y
sudo apt-get install -y gdb
- name: Build with Maven
run: |
cd ${MANDREL_IT_PATH}
export PATH="${GRAALVM_HOME}/bin:$PATH"
export QUARKUS_VERSION=${{ needs.get-test-matrix.outputs.quarkus-version }}
# Don't use SNAPSHOT version for 2.2 and release tags
if [ "${{ inputs.quarkus-version }}" == "2.2" ]
then
export QUARKUS_VERSION=2.2.999
elif $(expr match "${{ inputs.quarkus-version }}" "^[0-9]\+\.[0-9]\+$" > /dev/null)
then
# release branches use the branch name followed by .999-SNAPSHOT as the version
export QUARKUS_VERSION="${{ inputs.quarkus-version }}.999-SNAPSHOT"
elif ! $(expr match "$QUARKUS_VERSION" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION="999-SNAPSHOT"
fi
echo $QUARKUS_VERSION
if [[ ${{ inputs.builder-image }} == "null" ]]
then
${GRAALVM_HOME}/bin/native-image --version
mvn clean verify -Dquarkus.native.native-image-xmx=13g \
-Dquarkus.version=$QUARKUS_VERSION \
-Ptestsuite
else
mvn clean verify -Dquarkus.native.native-image-xmx=13g \
-Dquarkus.version=$QUARKUS_VERSION \
-Dquarkus.native.builder-image=${{ inputs.builder-image }} \
-Ptestsuite-builder-image
fi
- name: Prepare failure archive (if maven failed)
if: failure()
run: tar czvf test-reports-mandrel-it.tgz ${MANDREL_IT_PATH}/testsuite/target/archived-logs/
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports-mandrel-it-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'test-reports-mandrel-it.tgz'