Skip to content

Commit 9fe4858

Browse files
committed
Fix logging groups for GitHub output so they collapse correctly.
1 parent cb183f8 commit 9fe4858

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

bench_runner/templates/workflow_bootstrap.src.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def install_requirements(venv: Path) -> None:
5959

6060
def main():
6161
venv = Path("venv")
62-
print("::group::Creating venv")
62+
print("::group::Creating venv", file=sys.stderr)
6363
create_venv(venv)
64-
print("::endgroup::")
65-
print("::group::Installing requirements")
64+
print("::endgroup::", file=sys.stderr)
65+
print("::group::Installing requirements", file=sys.stderr)
6666
install_requirements(venv)
67-
print("::endgroup::")
67+
print("::endgroup::", file=sys.stderr)
6868

6969
# Now that we've installed the full bench_runner library,
7070
# continue on in a new process...

bench_runner/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ def get_simple_platform() -> Literal["linux", "macos", "windows"]:
9191

9292
@contextlib.contextmanager
9393
def log_group(text: str) -> Iterator:
94-
print(f"::group::{text}")
94+
print(f"::group::{text}", file=sys.stderr)
9595
try:
9696
yield
9797
finally:
98-
print("::endgroup::")
98+
print("::endgroup::", file=sys.stderr)
9999

100100
def track(iterable: Iterable, name: str) -> Iterable:
101101
with log_group(name):

0 commit comments

Comments
 (0)