Skip to content

Commit ab0bd86

Browse files
committed
buildkite: generate keys for per-arch steps
These will allow us to have x86 tests only block on x86 compilation, and arm tests only on arm compilation. Signed-off-by: Patrick Roy <[email protected]>
1 parent 0d98e2c commit ab0bd86

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.buildkite/common.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ def __init__(self, with_build_step=True, **kwargs):
258258
# Build sharing
259259
if with_build_step:
260260
build_cmds, self.shared_build = shared_build()
261-
self.build_group_per_arch("🏗️ Build", build_cmds, decorate=False)
261+
self.build_group_per_arch(
262+
"🏗️ Build", build_cmds, decorate=False, key_prefix="build"
263+
)
262264
self.steps += ["wait"]
263265
else:
264266
self.shared_build = None
@@ -307,13 +309,20 @@ def build_group(self, *args, **kwargs):
307309
combined = overlay_dict(self.per_instance, kwargs)
308310
return self.add_step(group(*args, **combined), decorate=decorate)
309311

310-
def build_group_per_arch(self, *args, **kwargs):
312+
def build_group_per_arch(self, label, *args, **kwargs):
311313
"""
312314
Build a group, parametrizing over the architectures only.
313315
"""
314316
decorate = kwargs.pop("decorate", True)
317+
key_prefix = kwargs.pop("key_prefix", None)
315318
combined = overlay_dict(self.per_arch, kwargs)
316-
return self.add_step(group(*args, **combined), decorate=decorate)
319+
grp = group(label, *args, **combined)
320+
if key_prefix:
321+
for step in grp["steps"]:
322+
step["key"] = (
323+
key_prefix + "_" + DEFAULT_INSTANCES[step["agents"]["instance"]]
324+
)
325+
return self.add_step(grp, decorate=decorate)
317326

318327
def to_dict(self):
319328
"""Render the pipeline as a dictionary."""

0 commit comments

Comments
 (0)