28
28
Calculate a matrix of which functions had source change, print that as
29
29
a JSON object.
30
30
31
- locate-baseline [--download] [--extract]
31
+ locate-baseline [--download] [--extract] [--tag TAG]
32
32
Locate the most recent benchmark baseline available in CI and, if flags
33
33
specify, download and extract it. Never exits with nonzero status if
34
34
downloading fails.
35
35
36
+ `--tag` can be specified to look for artifacts with a specific tag, such as
37
+ for a specific architecture.
38
+
36
39
Note that `--extract` will overwrite files in `iai-home`.
37
40
38
41
check-regressions [--home iai-home] [--allow-pr-override pr_number]
50
53
GIT = ["git" , "-C" , REPO_ROOT ]
51
54
DEFAULT_BRANCH = "master"
52
55
WORKFLOW_NAME = "CI" # Workflow that generates the benchmark artifacts
53
- ARTIFACT_GLOB = "baseline-icount*"
56
+ ARTIFACT_PREFIX = "baseline-icount*"
54
57
# Place this in a PR body to skip regression checks (must be at the start of a line).
55
58
REGRESSION_DIRECTIVE = "ci: allow-regressions"
56
59
# Place this in a PR body to skip extensive tests
@@ -278,13 +281,17 @@ def locate_baseline(flags: list[str]) -> None:
278
281
279
282
download = False
280
283
extract = False
284
+ tag = ""
281
285
282
286
while len (flags ) > 0 :
283
287
match flags [0 ]:
284
288
case "--download" :
285
289
download = True
286
290
case "--extract" :
287
291
extract = True
292
+ case "--tag" :
293
+ tag = flags [1 ]
294
+ flags = flags [1 :]
288
295
case _:
289
296
eprint (USAGE )
290
297
exit (1 )
@@ -333,8 +340,10 @@ def locate_baseline(flags: list[str]) -> None:
333
340
eprint ("skipping download step" )
334
341
return
335
342
343
+ artifact_glob = f"{ ARTIFACT_PREFIX } { f"-{ tag } " if tag else "" } *"
344
+
336
345
sp .run (
337
- ["gh" , "run" , "download" , str (job_id ), f"--pattern={ ARTIFACT_GLOB } " ],
346
+ ["gh" , "run" , "download" , str (job_id ), f"--pattern={ artifact_glob } " ],
338
347
check = False ,
339
348
)
340
349
@@ -344,7 +353,7 @@ def locate_baseline(flags: list[str]) -> None:
344
353
345
354
# Find the baseline with the most recent timestamp. GH downloads the files to e.g.
346
355
# `some-dirname/some-dirname.tar.xz`, so just glob the whole thing together.
347
- candidate_baselines = glob (f"{ ARTIFACT_GLOB } /{ ARTIFACT_GLOB } " )
356
+ candidate_baselines = glob (f"{ artifact_glob } /{ artifact_glob } " )
348
357
if len (candidate_baselines ) == 0 :
349
358
eprint ("no possible baseline directories found" )
350
359
return
0 commit comments