diff options
| author | bors <bors@rust-lang.org> | 2024-04-24 06:40:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-24 06:40:14 +0000 |
| commit | e7da0fa62fc58f9d665a67bf2e7a6d6154d8d74c (patch) | |
| tree | 8b4639250057328d852cb66ae14e2fbe06797bf0 /src/ci/scripts | |
| parent | 29a56a3b1c06a624c0c06728c0af756d09df6b1b (diff) | |
| parent | 2632c6139d9b1a7ca7be4da1924e7a78edfa452c (diff) | |
| download | rust-e7da0fa62fc58f9d665a67bf2e7a6d6154d8d74c.tar.gz rust-e7da0fa62fc58f9d665a67bf2e7a6d6154d8d74c.zip | |
Auto merge of #124175 - Kobzol:ci-dynamic-job, r=pietroalbini
CI: dynamic jobs This PR modifies our CI workflows to be dynamic. This means that when a GitHub event is generated, we will run a Python script (`calculate-job-matrix.py`), which decides which CI jobs should be generated. These jobs are defined in `src/ci/github-actions/jobs.yml`). This should provide a few benefits: - Once the migration to dynamic jobs is complete, we shouldn't need `expand-yaml-anchors` anymore. - The job table on PRs (and also the left job column on auto/try builds) should be much cleaner and contain only the jobs that are actually relevant/executed. - It should be much easier to support dynamic try builds, i.e. to run an arbitrary CI job on a try build. See [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/job.20matrix.20re-ordered.20PR.20list) for more context. r? `@ghost`
Diffstat (limited to 'src/ci/scripts')
| -rwxr-xr-x | src/ci/scripts/calculate-job-matrix.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/ci/scripts/calculate-job-matrix.py b/src/ci/scripts/calculate-job-matrix.py deleted file mode 100755 index 9b1e74c23c3..00000000000 --- a/src/ci/scripts/calculate-job-matrix.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/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)}") |
