Skip to content

Commit 3ef1214

Browse files
committed
CI: remove duplicate builds if jdk-lts is the same as jdk-new
1 parent ae3015e commit 3ef1214

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

ci.jsonnet

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,20 @@ local part_definitions = {
218218
jdk: {
219219
local with_path = { environment+: { path+:: ["$JAVA_HOME/bin"] } },
220220

221-
v17: with_path + common.jdks["labsjdk-ce-17"] + {
221+
local v17 = with_path + common.jdks["labsjdk-ce-17"] + {
222222
environment+: {
223223
JT_JDK: "17",
224224
},
225225
},
226226

227-
v21: with_path + common.jdks["labsjdk-ce-21"] + {
227+
local v21 = with_path + common.jdks["labsjdk-ce-21"] + {
228228
environment+: {
229229
JT_JDK: "21",
230230
},
231231
},
232232

233-
lts: self.v17,
234-
new: self.v21,
233+
lts: v17 + { jdk_label:: 'lts' },
234+
new: v21 + { jdk_label:: 'new' },
235235
},
236236

237237
platform: {
@@ -707,18 +707,26 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
707707

708708
builds:
709709
local all_builds = $.test_builds + $.bench_builds + $.manual_builds;
710+
local filtered_builds = if $.jdk.lts.jdk_version == $.jdk.new.jdk_version then
711+
{
712+
[k]: all_builds[k]
713+
for k in std.objectFields(all_builds)
714+
if !std.objectHasAll(all_builds[k], "jdk_label") || all_builds[k].jdk_label == $.jdk.lts.jdk_label
715+
}
716+
else
717+
all_builds;
710718
utils.check_builds(
711719
restrict_builds_to,
712720
# Move name inside into `name` field
713721
# and ensure timelimit is present
714722
[
715-
all_builds[k] {
723+
filtered_builds[k] {
716724
name: k,
717-
timelimit: if std.objectHas(all_builds[k], "timelimit")
718-
then all_builds[k].timelimit
725+
timelimit: if std.objectHas(filtered_builds[k], "timelimit")
726+
then filtered_builds[k].timelimit
719727
else error "Missing timelimit in " + k + " build.",
720728
}
721-
for k in std.objectFields(all_builds)
729+
for k in std.objectFields(filtered_builds)
722730
]
723731
),
724732
};

0 commit comments

Comments
 (0)