-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124175 - Kobzol:ci-dynamic-job, r=<try>
CI: dynamic jobs Opening as a draft to experiment with [dynamic CI jobs](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/job.20matrix.20re-ordered.20PR.20list). r? `@ghost`
- Loading branch information
Showing
16 changed files
with
130 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule backtrace
updated
10 files
+2 −3 | .github/workflows/check-binary-size.yml | |
+5 −14 | .github/workflows/main.yml | |
+8 −1 | Cargo.lock | |
+8 −8 | Cargo.toml | |
+20 −33 | src/backtrace/dbghelp64.rs | |
+49 −0 | src/capture.rs | |
+2 −0 | src/lib.rs | |
+1 −8 | src/symbolize/dbghelp.rs | |
+5 −2 | src/symbolize/gimli.rs | |
+12 −0 | tests/smoke.rs |
Submodule stdarch
updated
5 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/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 | ||
import os | ||
from pathlib import Path | ||
from typing import List, Dict | ||
|
||
import yaml | ||
|
||
JOBS_YAML_PATH = Path(__file__).absolute().parent / "jobs.yml" | ||
|
||
|
||
def name_jobs(jobs: List[Dict], prefix: str) -> List[Dict]: | ||
for job in jobs: | ||
job["name"] = f"{prefix} - {job['image']}" | ||
return jobs | ||
|
||
|
||
if __name__ == "__main__": | ||
github_ctx = json.loads(os.environ["GITHUB_CTX"]) | ||
|
||
with open(JOBS_YAML_PATH) as f: | ||
data = yaml.safe_load(f) | ||
|
||
event_name = github_ctx["event_name"] | ||
ref = github_ctx["ref"] | ||
repository = github_ctx["repository"] | ||
|
||
old_bors_try_build = ref in ("refs/heads/try", "refs/heads/try-perf") and repository == "rust-lang-ci/rust" | ||
new_bors_try_build = ref == "refs/heads/automation/bors/try" and repository == "rust-lang/rust" | ||
try_build = old_bors_try_build or new_bors_try_build | ||
|
||
jobs = [] | ||
# Pull request CI jobs. Their name is 'PR - <image>' | ||
if event_name == "pull_request": | ||
jobs = name_jobs(data["pr"], "PR") | ||
# Try builds | ||
elif event_name == "push" and try_build: | ||
jobs = name_jobs(data["try"], "try") | ||
|
||
print(f"jobs={json.dumps(jobs)}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.