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

Run Python formatting check in tidy on CI #134964

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
--stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
--stage 0 src/tools/tidy tidyselftest --extra-checks=py,cpp
Noratrieb marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 12 additions & 2 deletions src/ci/scripts/upload-build-metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ def upload_datadog_measure(name: str, value: float):
print(f"Metric {name}: {value:.4f}")

cmd = "npx"
if os.getenv("GITHUB_ACTIONS") is not None and sys.platform.lower().startswith("win"):
if os.getenv("GITHUB_ACTIONS") is not None and sys.platform.lower().startswith(
"win"
):
# Due to weird interaction of MSYS2 and Python, we need to use an absolute path,
# and also specify the ".cmd" at the end. See https://github.com/rust-lang/rust/pull/125771.
cmd = "C:\\Program Files\\nodejs\\npx.cmd"

subprocess.run(
[cmd, "datadog-ci", "measure", "--level", "job", "--measures", f"{name}:{value}"],
[
cmd,
"datadog-ci",
"measure",
"--level",
"job",
"--measures",
f"{name}:{value}",
],
check=False,
)

Expand Down
Loading