Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build_docs.py): filter benchmark artifacts by branch #1330

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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