Skip to content

Commit

Permalink
fix(build_docs.py): filter benchmark artifacts by branch (#1330)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli authored Aug 7, 2023
1 parent 5d4f56a commit 11089fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions distribution/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
import pytest
from flaky import flaky
from modflow_devtools.build import meson_build
from modflow_devtools.download import (download_and_unzip, download_artifact,
get_release, list_artifacts)
from modflow_devtools.download import (
download_and_unzip,
download_artifact,
get_release,
list_artifacts,
)
from modflow_devtools.markers import requires_exe, requires_github
from modflow_devtools.misc import is_in_ci, run_cmd, set_dir

Expand Down Expand Up @@ -112,6 +116,9 @@ def download_benchmarks(
key=lambda a: datetime.strptime(a["created_at"], "%Y-%m-%dT%H:%M:%SZ"),
reverse=True,
)
artifacts = [
a for a in artifacts if a["workflow_run"]["head_branch"] == "develop" # todo make configurable
]
most_recent = next(iter(artifacts), None)
print(f"Found most recent benchmarks (artifact {most_recent['id']})")
if most_recent:
Expand Down

0 comments on commit 11089fe

Please sign in to comment.