Skip to content

Commit 0264335

Browse files
committed
ci: Print elapsed time as part of verify-build
(backport <#4780>) (cherry picked from commit 5e95452)
1 parent c068f61 commit 0264335

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

ci/verify-build.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env python3
22

3-
import re
4-
import os
53
import argparse
4+
import os
5+
import platform
6+
import re
67
import subprocess as sp
78
import sys
8-
import platform
9-
from typing import Optional
10-
from enum import Enum, IntEnum
9+
import time
1110
from dataclasses import dataclass, field
11+
from enum import Enum, IntEnum
12+
from typing import Optional
1213

1314

1415
ESC_CYAN = "\033[1;36m"
@@ -235,6 +236,7 @@ def check_dup_targets():
235236

236237

237238
def test_target(cfg: Cfg, target: Target):
239+
start = time.time()
238240
env = os.environ.copy()
239241
env.setdefault("RUSTFLAGS", "")
240242

@@ -306,7 +308,8 @@ def test_target(cfg: Cfg, target: Target):
306308
else:
307309
eprint("Skipping semver checks")
308310

309-
eprint(f"Finished checking target {tname}")
311+
elapsed = round(time.time() - start, 2)
312+
eprint(f"Finished checking target {tname} in {elapsed} seconds")
310313

311314

312315
def main():
@@ -326,6 +329,7 @@ def main():
326329
eprint(f"Config: {cfg}")
327330
eprint("Python version: ", sys.version)
328331
check_dup_targets()
332+
start = time.time()
329333

330334
if cfg.nightly():
331335
# Needed for build-std
@@ -365,5 +369,8 @@ def main():
365369
test_target(cfg, target)
366370
eprint("::endgroup::")
367371

372+
elapsed = round(time.time() - start, 2)
373+
eprint(f"Checked {total} targets in {elapsed} seconds")
374+
368375

369376
main()

0 commit comments

Comments
 (0)