about summary refs log tree commit diff
path: root/src/ci/scripts
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-16 06:41:11 +0000
committerbors <bors@rust-lang.org>2024-04-16 06:41:11 +0000
commit88d1a1c6fdf6e607606876cdab672eebdf6a3c71 (patch)
tree438ae4e11b312666a2c073fff0184ec42aa7274f /src/ci/scripts
parent2f08c2c96501990caab0e47a095d76ffd6a31f16 (diff)
parent3d3a584e4d88a572d68d7996122cda69a38dcf2e (diff)
downloadrust-88d1a1c6fdf6e607606876cdab672eebdf6a3c71.tar.gz
rust-88d1a1c6fdf6e607606876cdab672eebdf6a3c71.zip
Auto merge of #3469 - rust-lang:rustup-2024-04-16, r=RalfJung
Automatic Rustup
Diffstat (limited to 'src/ci/scripts')
-rwxr-xr-xsrc/ci/scripts/calculate-job-matrix.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ci/scripts/calculate-job-matrix.py b/src/ci/scripts/calculate-job-matrix.py
new file mode 100755
index 00000000000..9b1e74c23c3
--- /dev/null
+++ b/src/ci/scripts/calculate-job-matrix.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+
+"""
+This script serves for generating a matrix of jobs that should
+be executed on CI.
+
+It reads job definitions from `src/ci/github-actions/jobs.yml`
+and filters them based on the event that happened on CI.
+
+Currently, it only supports PR builds.
+"""
+
+import json
+from pathlib import Path
+
+import yaml
+
+JOBS_YAML_PATH = Path(__file__).absolute().parent.parent / "github-actions" / "jobs.yml"
+
+
+if __name__ == "__main__":
+    with open(JOBS_YAML_PATH) as f:
+        jobs = yaml.safe_load(f)
+    job_output = jobs["pr"]
+    print(f"jobs={json.dumps(job_output)}")