96
96
steps :
97
97
- name : Build
98
98
run : sleep 30
99
+ runs-on :
100
+ name : " Configure Runs-On"
101
+ runs-on : ubuntu-latest
102
+ outputs :
103
+ config : ${{ steps.configure.outputs.config }}
104
+ steps :
105
+ - name : Set up JDK 21
106
+ uses : actions/setup-java@v4
107
+ with :
108
+ distribution : temurin
109
+ java-version : 21
110
+ - name : Configure Runs-On
111
+ id : configure
112
+ uses : quarkusio/runs-on-action@main
113
+ with :
114
+ github-token : ${{ secrets.GITHUB_TOKEN }}
115
+ main-repository : quarkusio/quarkus
116
+ runs-on : true
117
+
99
118
build-jdk17 :
100
119
name : " Initial JDK 17 Build"
101
- runs-on : ubuntu-latest
120
+ needs : [ runs-on ]
121
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners['ubuntu-latest'].runsOn || 'ubuntu-latest' }}
102
122
# Skip main in forks
103
123
# Skip draft PRs, rerun as soon as its removed
104
124
if : " (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main')) && ( \
@@ -108,6 +128,8 @@ jobs:
108
128
github.event.action != 'edited' \
109
129
) \
110
130
)"
131
+ env :
132
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners['ubuntu-latest'].runsOn && 'true' || 'false' }}
111
133
outputs :
112
134
gib_args : ${{ steps.get-gib-args.outputs.gib_args }}
113
135
gib_impacted : ${{ steps.get-gib-impacted.outputs.impacted_modules }}
@@ -149,7 +171,7 @@ jobs:
149
171
echo "quarkus-metadata-cache-key-default=quarkus-metadata-cache-${CURRENT_WEEK}-${{ github.event.repository.default_branch }}" >> $GITHUB_OUTPUT
150
172
- name : Cache Maven Repository
151
173
id : cache-maven
152
- uses : actions /cache@v4
174
+ uses : quarkusio /cache-action @v4
153
175
# if it's not a pull request, we restore and save the cache
154
176
if : github.event_name != 'pull_request'
155
177
with :
@@ -161,8 +183,9 @@ jobs:
161
183
restore-keys : |
162
184
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}-
163
185
${{ steps.cache-key.outputs.m2-monthly-cache-key }}-
186
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
164
187
- name : Restore Maven Repository
165
- uses : actions /cache/restore@v4
188
+ uses : quarkusio /cache-action /restore@v4
166
189
# if it a pull request, we restore the cache but we don't save it
167
190
if : github.event_name == 'pull_request'
168
191
with :
@@ -171,14 +194,16 @@ jobs:
171
194
restore-keys : |
172
195
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}-
173
196
${{ steps.cache-key.outputs.m2-monthly-cache-key }}-
197
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
174
198
- name : Cache Develocity local cache
175
- uses : actions /cache@v4
199
+ uses : quarkusio /cache-action @v4
176
200
if : github.event_name == 'pull_request'
177
201
with :
178
202
path : ~/.m2/.develocity/build-cache
179
203
key : develocity-cache-Initial JDK 17 Build-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
180
204
restore-keys : |
181
205
develocity-cache-Initial JDK 17 Build-${{ github.event.pull_request.number }}-
206
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
182
207
- name : Populate the cache
183
208
# only populate the cache if it's not a pull request as we only store the cache in this case
184
209
if : github.event_name != 'pull_request'
@@ -341,14 +366,15 @@ jobs:
341
366
342
367
jvm-tests :
343
368
name : ${{ matrix.java.name }}
344
- runs-on : ${{ matrix.java.os-name }}
345
- needs : [build-jdk17, calculate-test-jobs]
369
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn || matrix.java.os-name }}
370
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
346
371
# Skip main in forks
347
372
if : " needs.calculate-test-jobs.outputs.run_jvm == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
348
373
timeout-minutes : 400
349
374
env :
350
375
MAVEN_OPTS : ${{ matrix.java.maven_opts }}
351
376
JAVA_VERSION_GRADLE : ${{ matrix.java.java-version-gradle || matrix.java.java-version }}
377
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
352
378
strategy :
353
379
fail-fast : false
354
380
matrix : ${{ fromJson(needs.calculate-test-jobs.outputs.jvm_matrix) }}
@@ -404,13 +430,14 @@ jobs:
404
430
architecture : ${{ matrix.java.architecture || 'x64' }}
405
431
406
432
- name : Restore Maven Repository
407
- uses : actions /cache/restore@v4
433
+ uses : quarkusio /cache-action /restore@v4
408
434
with :
409
435
path : ~/.m2/repository
410
436
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
411
437
restore-keys : |
412
438
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
413
439
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
440
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
414
441
- name : Download previously uploaded .m2 content
415
442
uses : actions/download-artifact@v4
416
443
with :
@@ -419,13 +446,14 @@ jobs:
419
446
- name : Extract previously uploaded .m2 content
420
447
run : tar -xzf m2-content.tgz -C ~
421
448
- name : Cache Develocity local cache
422
- uses : actions /cache@v4
449
+ uses : quarkusio /cache-action @v4
423
450
if : github.event_name == 'pull_request'
424
451
with :
425
452
path : ~/.m2/.develocity/build-cache
426
453
key : develocity-cache-${{matrix.java.name}}-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
427
454
restore-keys : |
428
455
develocity-cache-${{matrix.java.name}}-${{ github.event.pull_request.number }}-
456
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
429
457
- name : Setup Develocity Build Scan capture
430
458
uses :
gradle/develocity-actions/[email protected]
431
459
with :
@@ -499,10 +527,11 @@ jobs:
499
527
500
528
maven-tests :
501
529
name : Maven Tests - JDK ${{matrix.java.name}}
502
- runs-on : ${{ matrix.java.os-name }}
503
- needs : [build-jdk17, calculate-test-jobs]
530
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn || matrix.java.os-name }}
531
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
504
532
env :
505
533
MAVEN_OPTS : -Xmx2g -XX:MaxMetaspaceSize=1g
534
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
506
535
# Skip main in forks
507
536
if : " needs.calculate-test-jobs.outputs.run_maven == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
508
537
timeout-minutes : 130
@@ -535,13 +564,14 @@ jobs:
535
564
- name : Add quarkusio remote for GIB
536
565
run : git remote show quarkusio &> /dev/null || git remote add quarkusio https://github.com/quarkusio/quarkus.git
537
566
- name : Restore Maven Repository
538
- uses : actions /cache/restore@v4
567
+ uses : quarkusio /cache-action /restore@v4
539
568
with :
540
569
path : ~/.m2/repository
541
570
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
542
571
restore-keys : |
543
572
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
544
573
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
574
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
545
575
- name : Download previously uploaded .m2 content
546
576
uses : actions/download-artifact@v4
547
577
with :
@@ -605,11 +635,12 @@ jobs:
605
635
606
636
gradle-tests :
607
637
name : Gradle Tests - JDK ${{matrix.java.name}}
608
- runs-on : ${{matrix.java.os-name}}
609
- needs : [build-jdk17, calculate-test-jobs]
638
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.java.os-name].runsOn || matrix.java.os-name }}
639
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
610
640
env :
611
641
# leave more space for the actual gradle execution (which is just wrapped by maven)
612
642
MAVEN_OPTS : -Xmx1g
643
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
613
644
# Skip main in forks
614
645
if : " needs.calculate-test-jobs.outputs.run_gradle == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
615
646
timeout-minutes : 120
@@ -637,13 +668,14 @@ jobs:
637
668
run : git config --global core.longpaths true
638
669
- uses : actions/checkout@v4
639
670
- name : Restore Maven Repository
640
- uses : actions /cache/restore@v4
671
+ uses : quarkusio /cache-action /restore@v4
641
672
with :
642
673
path : ~/.m2/repository
643
674
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
644
675
restore-keys : |
645
676
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
646
677
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
678
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
647
679
- name : Download previously uploaded .m2 content
648
680
uses : actions/download-artifact@v4
649
681
with :
@@ -695,10 +727,12 @@ jobs:
695
727
696
728
devtools-tests :
697
729
name : Devtools Tests - JDK ${{matrix.java.name}}
698
- runs-on : ${{matrix.java.os-name}}
699
- needs : [build-jdk17, calculate-test-jobs]
730
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.java.os-name].runsOn || matrix.java.os-name }}
731
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
700
732
# Skip main in forks
701
733
if : " needs.calculate-test-jobs.outputs.run_devtools == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
734
+ env :
735
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
702
736
timeout-minutes : 60
703
737
strategy :
704
738
fail-fast : false
@@ -729,13 +763,14 @@ jobs:
729
763
run : git config --global core.longpaths true
730
764
- uses : actions/checkout@v4
731
765
- name : Restore Maven Repository
732
- uses : actions /cache/restore@v4
766
+ uses : quarkusio /cache-action /restore@v4
733
767
with :
734
768
path : ~/.m2/repository
735
769
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
736
770
restore-keys : |
737
771
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
738
772
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
773
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
739
774
- name : Download previously uploaded .m2 content
740
775
uses : actions/download-artifact@v4
741
776
with :
@@ -791,10 +826,12 @@ jobs:
791
826
792
827
kubernetes-tests :
793
828
name : Kubernetes Tests - JDK ${{matrix.java.name}}
794
- runs-on : ${{matrix.java.os-name}}
795
- needs : [build-jdk17, calculate-test-jobs]
829
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.java.os-name].runsOn || matrix.java.os-name }}
830
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
796
831
# Skip main in forks
797
832
if : " needs.calculate-test-jobs.outputs.run_kubernetes == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
833
+ env :
834
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
798
835
timeout-minutes : 40
799
836
strategy :
800
837
fail-fast : false
@@ -825,13 +862,14 @@ jobs:
825
862
run : git config --global core.longpaths true
826
863
- uses : actions/checkout@v4
827
864
- name : Restore Maven Repository
828
- uses : actions /cache/restore@v4
865
+ uses : quarkusio /cache-action /restore@v4
829
866
with :
830
867
path : ~/.m2/repository
831
868
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
832
869
restore-keys : |
833
870
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
834
871
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
872
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
835
873
- name : Download previously uploaded .m2 content
836
874
uses : actions/download-artifact@v4
837
875
with :
@@ -887,10 +925,12 @@ jobs:
887
925
888
926
quickstarts-tests :
889
927
name : Quickstarts Compilation - JDK ${{matrix.java.name}}
890
- runs-on : ${{matrix.java.os-name}}
891
- needs : [build-jdk17, calculate-test-jobs]
928
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.java.os-name].runsOn || matrix.java.os-name }}
929
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
892
930
# Skip main in forks
893
931
if : " needs.calculate-test-jobs.outputs.run_quickstarts == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
932
+ env :
933
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.java.os-name].runsOn && 'true' || 'false' }}
894
934
timeout-minutes : 90
895
935
strategy :
896
936
fail-fast : false
@@ -908,13 +948,14 @@ jobs:
908
948
echo "GE_CUSTOM_VALUES=gh-job-name=Quickstarts Compilation - JDK ${{matrix.java.name}}" >> "$GITHUB_ENV"
909
949
- uses : actions/checkout@v4
910
950
- name : Restore Maven Repository
911
- uses : actions /cache/restore@v4
951
+ uses : quarkusio /cache-action /restore@v4
912
952
with :
913
953
path : ~/.m2/repository
914
954
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
915
955
restore-keys : |
916
956
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
917
957
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
958
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
918
959
- name : Download previously uploaded .m2 content
919
960
uses : actions/download-artifact@v4
920
961
with :
@@ -980,10 +1021,12 @@ jobs:
980
1021
981
1022
virtual-thread-native-tests :
982
1023
name : Native Tests - Virtual Thread - ${{matrix.category}}
983
- runs-on : ${{matrix.os-name}}
984
- needs : [build-jdk17, calculate-test-jobs]
1024
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.os-name].runsOn || matrix.os-name }}
1025
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
985
1026
# Skip main in forks
986
1027
if : " needs.calculate-test-jobs.outputs.virtual_threads_matrix != '{}' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
1028
+ env :
1029
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.os-name].runsOn && 'true' || 'false' }}
987
1030
timeout-minutes : ${{matrix.timeout}}
988
1031
strategy :
989
1032
max-parallel : 12
@@ -997,13 +1040,14 @@ jobs:
997
1040
echo "GE_CUSTOM_VALUES=gh-job-name=Native Tests - Virtual Thread - ${{matrix.category}}" >> "$GITHUB_ENV"
998
1041
- uses : actions/checkout@v4
999
1042
- name : Restore Maven Repository
1000
- uses : actions /cache/restore@v4
1043
+ uses : quarkusio /cache-action /restore@v4
1001
1044
with :
1002
1045
path : ~/.m2/repository
1003
1046
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
1004
1047
restore-keys : |
1005
1048
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
1006
1049
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
1050
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
1007
1051
- name : Download previously uploaded .m2 content
1008
1052
uses : actions/download-artifact@v4
1009
1053
with :
@@ -1057,10 +1101,12 @@ jobs:
1057
1101
1058
1102
tcks-test :
1059
1103
name : MicroProfile TCKs Tests
1060
- needs : [build-jdk17, calculate-test-jobs]
1104
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
1061
1105
# Skip main in forks
1062
1106
if : " needs.calculate-test-jobs.outputs.run_tcks == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
1063
- runs-on : ubuntu-latest
1107
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners['ubuntu-latest'].runsOn || 'ubuntu-latest' }}
1108
+ env :
1109
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners['ubuntu-latest'].runsOn && 'true' || 'false' }}
1064
1110
timeout-minutes : 150
1065
1111
steps :
1066
1112
- name : Gradle Enterprise environment
@@ -1081,13 +1127,14 @@ jobs:
1081
1127
distribution : temurin
1082
1128
java-version : 17
1083
1129
- name : Restore Maven Repository
1084
- uses : actions /cache/restore@v4
1130
+ uses : quarkusio /cache-action /restore@v4
1085
1131
with :
1086
1132
path : ~/.m2/repository
1087
1133
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
1088
1134
restore-keys : |
1089
1135
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
1090
1136
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
1137
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
1091
1138
- name : Download previously uploaded .m2 content
1092
1139
uses : actions/download-artifact@v4
1093
1140
with :
@@ -1142,11 +1189,12 @@ jobs:
1142
1189
1143
1190
native-tests :
1144
1191
name : Native Tests - ${{matrix.category}}
1145
- needs : [build-jdk17, calculate-test-jobs]
1146
- runs-on : ${{matrix.os-name}}
1192
+ needs : [runs-on, build-jdk17, calculate-test-jobs]
1193
+ runs-on : ${{ fromJson(needs.runs-on.outputs.config).runners[ matrix.os-name].runsOn || matrix.os-name }}
1147
1194
env :
1148
1195
# leave more space for the actual native compilation and execution
1149
1196
MAVEN_OPTS : -Xmx1g
1197
+ RUNS_ON_ENABLED : ${{ fromJson(needs.runs-on.outputs.config).runners[matrix.os-name].runsOn && 'true' || 'false' }}
1150
1198
# Skip main in forks
1151
1199
if : " needs.calculate-test-jobs.outputs.native_matrix != '{}' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
1152
1200
# Ignore the following YAML Schema error
@@ -1194,13 +1242,14 @@ jobs:
1194
1242
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Quarkus-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json
1195
1243
fi
1196
1244
- name : Restore Maven Repository
1197
- uses : actions /cache/restore@v4
1245
+ uses : quarkusio /cache-action /restore@v4
1198
1246
with :
1199
1247
path : ~/.m2/repository
1200
1248
key : ${{ needs.build-jdk17.outputs.m2-cache-key }}
1201
1249
restore-keys : |
1202
1250
${{ needs.build-jdk17.outputs.m2-monthly-branch-cache-key }}-
1203
1251
${{ needs.build-jdk17.outputs.m2-monthly-cache-key }}-
1252
+ runs-on : ${{ env.RUNS_ON_ENABLED }}
1204
1253
- name : Download previously uploaded .m2 content
1205
1254
uses : actions/download-artifact@v4
1206
1255
with :
0 commit comments