Skip to content

Commit

Permalink
[ci] Do not print docker instructions if on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo committed Dec 31, 2024
1 parent 2b63614 commit 6f17b78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
calc_options_hash,
subprocess_with_log,
subprocess_with_capture,
upload_file
upload_file,
is_macos
)
import build_utils

Expand Down Expand Up @@ -92,7 +93,7 @@ def main():
# Differentiate between macos versions: it's possible to have the same label
# for different macos versions, especially different minor versions.
macos_version_prefix = ''
if 'Darwin' == platform.system():
if is_macos():
macos_version_tuple = platform.mac_ver()
macos_version = macos_version_tuple[0]
macos_version_prefix = f'{macos_version}/'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/root-ci-config/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import textwrap
import datetime
import time
import platform
from functools import wraps
from hashlib import sha1
from http import HTTPStatus
Expand All @@ -17,6 +18,9 @@
from openstack.connection import Connection
from requests import get

def is_macos():
return 'Darwin' == platform.system()

class SimpleTimer:
def __init__(self):
self._start_time = time.perf_counter()
Expand Down Expand Up @@ -72,7 +76,7 @@ def add(self, command: str) -> None:
@github_log_group("To replicate this build locally")
def print(self) -> None:
if self.trace != "":
if self.image:
if self.image and not is_macos():
print(f"""\
# Grab the image and set up the python virtual environment:
docker run {' '.join(self.docker_opts)} -it registry.cern.ch/root-ci/{self.image}:buildready
Expand Down

0 comments on commit 6f17b78

Please sign in to comment.