diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2024-12-23 10:12:23 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-23 10:12:23 +0000 |
| commit | 8dbdcc03ebfd5d3c21671d8a021669dc79d93038 (patch) | |
| tree | e61d058d30fdd35c4a306fde5be669b08092a4fd /src/ci/scripts | |
| parent | 63a3c394617b114a8fa6e54401700b3adee65a7d (diff) | |
| parent | 0180d2d16f5f5d60384a594568a98a6e6f8eea59 (diff) | |
| download | rust-8dbdcc03ebfd5d3c21671d8a021669dc79d93038.tar.gz rust-8dbdcc03ebfd5d3c21671d8a021669dc79d93038.zip | |
Merge pull request #18746 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'src/ci/scripts')
| -rw-r--r-- | src/ci/scripts/upload-build-metrics.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ci/scripts/upload-build-metrics.py b/src/ci/scripts/upload-build-metrics.py index 23061884a39..49c068c9a40 100644 --- a/src/ci/scripts/upload-build-metrics.py +++ b/src/ci/scripts/upload-build-metrics.py @@ -9,8 +9,8 @@ It expects the following environment variables: - DATADOG_API_KEY: DataDog API token - DD_GITHUB_JOB_NAME: Name of the current GitHub Actions job -And it also expects the presence of a binary called `datadog-ci` to be in PATH. -It can be installed with `npm install -g @datadog/datadog-ci`. +It expects the presence of a binary called `datadog-ci` inside `node_modules`. +It can be installed with `npm ci` at `src/ci`. Usage: ```bash @@ -50,16 +50,14 @@ def upload_datadog_measure(name: str, value: float): """ print(f"Metric {name}: {value:.4f}") - datadog_cmd = "datadog-ci" - if os.getenv("GITHUB_ACTIONS") is not None and sys.platform.lower().startswith( - "win" - ): + cmd = "npx" + 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. - datadog_cmd = "C:\\npm\\prefix\\datadog-ci.cmd" + cmd = "C:\\Program Files\\nodejs\\npx.cmd" subprocess.run( - [datadog_cmd, "measure", "--level", "job", "--measures", f"{name}:{value}"], + [cmd, "datadog-ci", "measure", "--level", "job", "--measures", f"{name}:{value}"], check=False, ) |
