only run ci jobs for changed files - #5354
Conversation
|
@rustbot ready |
|
@JohnTitor could u please review it |
This comment has been minimized.
This comment has been minimized.
|
|
could u please reivew this @weihanglo |
dc4577a to
d4990e8
Compare
|
Please be patient awaiting reviews, it can take a few weeks. No need to ping maintainers. |
sorry next time it wont happed |
There was a problem hiding this comment.
This will be a nice change for anyone working on a specific target, but I think we should go about it differently. Instead of doing some tricky things skipping steps with groups, I'd rather the python file generate the the T1, T2, and T2 VM matrices directly. That should have a cleaner CI file and also make it more clear which jobs actually got ran (as opposed to showing a green check but not actually doing something).
For an example see matrix generation at https://github.com/rust-lang/compiler-builtins/blob/9f542c0f7d9cf80949797a6212162c3d84aceffb/.github/workflows/main.yaml#L26-L49 and the use at https://github.com/rust-lang/compiler-builtins/blob/9f542c0f7d9cf80949797a6212162c3d84aceffb/.github/workflows/main.yaml#L385-L391. I'd like to keep things in libc looking somewhat similar to those.
Also important note, we need to run the complete CI in the merge queue regardless of what's changed.
|
Reminder, once the PR becomes ready for a review, use |
a72f3db to
556b895
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
556b895 to
4d23e84
Compare
4d23e84 to
8e8167c
Compare
I updated the CI script, |
|
@rustbot ready |
There was a problem hiding this comment.
Since this is changing quite a bit, let's shrink the scope. Could you drop everything related to autodetecting which files indicate which target changes? I.e. get things working exactly as they currently are but using the python script rather than matrix.
Detecting what to run can come in a followup.
| TIER1 = [ | ||
| {"group" : "apple" ,"target":"aarch64-apple-darwin" ,"os":"macos-26" } , | ||
| { "group": "windows_msvc" ,"target": "aarch64-pc-windows-msvc", "os": "windows-11-arm" }, | ||
| {"group": "linux", "target": "aarch64-unknown-linux-gnu", "os": "ubuntu-26.04-arm"}, | ||
| {"group" : "windows_gnu" , "target": "i686-pc-windows-gnu","os":"windows-2025" } , | ||
| { "group":"windows_msvc","target":"i686-pc-windows-msvc","os" : "windows-2025"}, | ||
| {"group": "linux", "target": "i686-unknown-linux-gnu"}, | ||
| {"group": "windows_gnu", "target": "x86_64-pc-windows-gnu", "os": "windows-2025"}, | ||
| {"group": "windows_msvc", "target": "x86_64-pc-windows-msvc", "os": "windows-2025"}, | ||
| {"group": "linux", "target": "x86_64-unknown-linux-gnu"}, | ||
| ] |
There was a problem hiding this comment.
Use a dataclass to merge all targets into a single list:
class Tier(IntEnum):
T1 = 1
T2 = 2
T3 = 3
@dataclass
class TestTarget:
name: str
os: str
tier: Tier
vm: bool = False
env: dict[str, str] = field(default_factory=dict)
artifact_tag: str | None = NoneStill keep them grouped by tier, though.
| return p.startswith(pat[:-3]) if pat.endswith("/**") else fnmatch.fnmatch(p, pat) | ||
|
|
||
|
|
||
| def groups_for(files) : |
There was a problem hiding this comment.
Doc comments and type annotations, please
| code = [p for p in files if not any(match(p, d) for d in DOCS)] | ||
|
|
||
|
|
||
| if not code: | ||
| return [] | ||
| hit = set () | ||
| for p in code: | ||
| gs= { g for g , pats in PLATFORMS.items ( )if any(match (p ,x)for x in pats )} |
There was a problem hiding this comment.
This file has chaotic formatting like this, please run through black
| - name: check if any dependency failed | ||
| run: jq --exit-status 'all(.result == "success")' <<< "$NEEDS" | ||
| run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< "$NEEDS" |
closes #3445