Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the build job name instead of success in ci-checks for rustc_codegen_gcc #1648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antoyo
Copy link
Contributor

@antoyo antoyo commented Jan 27, 2025

The job name should be build and not success.

@antoyo
Copy link
Contributor Author

antoyo commented Jan 27, 2025

I wonder if this is the correct solution, since we have multiple workflow files.
Any idea?

@Kobzol
Copy link
Contributor

Kobzol commented Jan 27, 2025

Do you want all the workflows to succeed for a PR to be merged? In general, for a branch protection, you need to specify job names that have to succeed. Usually, if there are multiple jobs in a workflow, we create a single "success" job that merges their results together.

If there are multiple workflows, there would have to be multiple success jobs per workflow (or maybe it's enough to name them all in the same way? not sure how that works).

I think that build on its own will not work here, because the build job actually uses a CI matrix, so it will actually generate a bunch of jobs, which will all be named differently. In that case it's best to create a success job to make the branch protection easier.

Here is a PR that adds a success job to the (main?) ci.yml workflow.

@tgross35
Copy link
Contributor

If you expect them to all be successful, I think you can add another .github/workflow job that depends on all the other.yaml files https://stackoverflow.com/a/64733705/5380651.

@Kobzol
Copy link
Contributor

Kobzol commented Jan 27, 2025

I don't think that we use that anywhere in rust-lang for marking CI success, but we could test drive it here 😆 https://github.com/rust-lang/rust-bindgen/blob/59a43e10b758bd86275aefceae29e874157087d8/.github/workflows/publish.yml#L4 is an example where it is used to publish crates to crates.io.

@tgross35
Copy link
Contributor

How nice would it be if GH just had an easy way to do "required: all jobs" 🙃

@antoyo
Copy link
Contributor Author

antoyo commented Jan 28, 2025

If you expect them to all be successful, I think you can add another .github/workflow job that depends on all the other.yaml files https://stackoverflow.com/a/64733705/5380651.

From what I can see in the comments, this will only be ran on the default branch, so I believe this would not work for what we want to do.
Am I missing something?

@tgross35
Copy link
Contributor

Oh, I don't know then. Maybe it works if branches: [main] is omitted? I haven't actually used this either.

If not, would it be feasible to combine the workflows that need to run for a PR to a single file?

@tgross35
Copy link
Contributor

I guess there isn't much harm in just trying the PR here either but being ready to revert if GH doesn't like it. When multiple jobs have the same name the gh CLI tool also needs the job file name to disambiguate, but branch protection won't care that there are multiple jobs named build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants