2828 Calculate a matrix of which functions had source change, print that as
2929 a JSON object.
3030
31- locate-baseline [--download] [--extract]
31+ locate-baseline [--download] [--extract] [--tag TAG]
3232 Locate the most recent benchmark baseline available in CI and, if flags
3333 specify, download and extract it. Never exits with nonzero status if
3434 downloading fails.
3535
36+ `--tag` can be specified to look for artifacts with a specific tag, such as
37+ for a specific architecture.
38+
3639 Note that `--extract` will overwrite files in `iai-home`.
3740
3841 check-regressions [--home iai-home] [--allow-pr-override pr_number]
5053GIT = ["git" , "-C" , REPO_ROOT ]
5154DEFAULT_BRANCH = "master"
5255WORKFLOW_NAME = "CI" # Workflow that generates the benchmark artifacts
53- ARTIFACT_GLOB = "baseline-icount*"
56+ ARTIFACT_PREFIX = "baseline-icount*"
5457# Place this in a PR body to skip regression checks (must be at the start of a line).
5558REGRESSION_DIRECTIVE = "ci: allow-regressions"
5659# Place this in a PR body to skip extensive tests
@@ -278,13 +281,17 @@ def locate_baseline(flags: list[str]) -> None:
278281
279282 download = False
280283 extract = False
284+ tag = ""
281285
282286 while len (flags ) > 0 :
283287 match flags [0 ]:
284288 case "--download" :
285289 download = True
286290 case "--extract" :
287291 extract = True
292+ case "--tag" :
293+ tag = flags [1 ]
294+ flags = flags [1 :]
288295 case _:
289296 eprint (USAGE )
290297 exit (1 )
@@ -333,8 +340,10 @@ def locate_baseline(flags: list[str]) -> None:
333340 eprint ("skipping download step" )
334341 return
335342
343+ artifact_glob = f"{ ARTIFACT_PREFIX } { f"-{ tag } " if tag else "" } *"
344+
336345 sp .run (
337- ["gh" , "run" , "download" , str (job_id ), f"--pattern={ ARTIFACT_GLOB } " ],
346+ ["gh" , "run" , "download" , str (job_id ), f"--pattern={ artifact_glob } " ],
338347 check = False ,
339348 )
340349
@@ -344,7 +353,7 @@ def locate_baseline(flags: list[str]) -> None:
344353
345354 # Find the baseline with the most recent timestamp. GH downloads the files to e.g.
346355 # `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 } " )
348357 if len (candidate_baselines ) == 0 :
349358 eprint ("no possible baseline directories found" )
350359 return
0 commit comments