-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Improve GitHub Actions CI config #13317
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Regardless, let's see if it works with bors @bors try |
Improve GitHub Actions CI config This pull request improves Cargo CI by: 1. Explicitly listing the branches the main CI should be run on (to avoid running on unwanted branches, particularly in forks) 2. By adding a [concurrency](https://docs.github.com/en/actions/using-jobs/using-concurrency) config so that only one "CI" runs for each "group" (one by PR), very inspired by rust-lang/rust [one](https://github.com/rust-lang/rust/blob/c485ee71477a29041895c47cc441b364670f3772/.github/workflows/ci.yml#L35) 3. By making all the jobs run only if triggered from this repository (to avoid having forks unnecessarily run CI jobs) 4. By making all the checkouts take `fetch-depth: 2` like done in [rust-lang/rust](https://github.com/rust-lang/rust/blob/c485ee71477a29041895c47cc441b364670f3772/.github/workflows/ci.yml#L452-L455) (to avoid unnecessary work, saves bandwidth and maybe a bit of time) The main motivation for this PR was (at first) to make the CI jobs not run on forks since it's a waste of CI resources as well as always failing (like [this](https://github.com/Urgau/cargo/actions/runs/7567435677/job/20606586124)); but after looking at the `main.yml` config I took the opportunity to improve the situation by using rust-lang/rust [ci.yml](https://github.com/rust-lang/rust/blob/master/.github/workflows/ci.yml) as reference.
c60488f
to
e30dac4
Compare
Hum, I have been informed by @weihanglo that apparently I believe this is due to an overly constrained condition in the |
Sure. Do it again. @bors try |
Improve GitHub Actions CI config This pull request improves Cargo CI by: 1. Explicitly listing the branches the main CI should be run on (to avoid running on unwanted branches, particularly in forks) 2. By adding a [concurrency](https://docs.github.com/en/actions/using-jobs/using-concurrency) config so that only one "CI" runs for each "group" (one by PR), very inspired by rust-lang/rust [one](https://github.com/rust-lang/rust/blob/c485ee71477a29041895c47cc441b364670f3772/.github/workflows/ci.yml#L35) 3. ~~By making all the jobs run only if triggered from this repository (to avoid having forks unnecessarily run CI jobs)~~ 4. ~~By making all the checkouts take `fetch-depth: 2` like done in [rust-lang/rust](https://github.com/rust-lang/rust/blob/c485ee71477a29041895c47cc441b364670f3772/.github/workflows/ci.yml#L452-L455) (to avoid unnecessary work, saves bandwidth and maybe a bit of time)~~ The main motivation for this PR was (at first) to make the CI jobs not run on forks since it's a waste of CI resources as well as always failing (like [this](https://github.com/Urgau/cargo/actions/runs/7567435677/job/20606586124)); but after looking at the `main.yml` config I took the opportunity to improve the situation by using rust-lang/rust [ci.yml](https://github.com/rust-lang/rust/blob/master/.github/workflows/ci.yml) as reference.
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
Looks like everything is good? @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 10 commits in 1ae631085f01c1a72d05df1ec81f3759a8360042..7bb7b539558dc88bea44cee4168b6269bf8177b0 2024-01-17 17:26:41 +0000 to 2024-01-20 00:15:32 +0000 - feat: inherit jobserver from env for all kinds of runner (rust-lang/cargo#12776) - Fix static_mut_ref warning. (rust-lang/cargo#13329) - fix(trim-paths): remap common prefix only (rust-lang/cargo#13210) - fix(cargo-rustdoc): use same path by output format logic everywhere (rust-lang/cargo#13325) - chore: Make MSRV=N-2 the workspace default (rust-lang/cargo#13324) - Fix precise-prerelease tracking link. (rust-lang/cargo#13320) - test(pkgid): keep package ID format in sync (rust-lang/cargo#13322) - Improve GitHub Actions CI config (rust-lang/cargo#13317) - Go back to passing an empty `values()` when no features are declared (rust-lang/cargo#13316) - fix(`--package`): accept `?` if it's a valid pkgid spec (rust-lang/cargo#13315) r? ghost
Update cargo 10 commits in 1ae631085f01c1a72d05df1ec81f3759a8360042..7bb7b539558dc88bea44cee4168b6269bf8177b0 2024-01-17 17:26:41 +0000 to 2024-01-20 00:15:32 +0000 - feat: inherit jobserver from env for all kinds of runner (rust-lang/cargo#12776) - Fix static_mut_ref warning. (rust-lang/cargo#13329) - fix(trim-paths): remap common prefix only (rust-lang/cargo#13210) - fix(cargo-rustdoc): use same path by output format logic everywhere (rust-lang/cargo#13325) - chore: Make MSRV=N-2 the workspace default (rust-lang/cargo#13324) - Fix precise-prerelease tracking link. (rust-lang/cargo#13320) - test(pkgid): keep package ID format in sync (rust-lang/cargo#13322) - Improve GitHub Actions CI config (rust-lang/cargo#13317) - Go back to passing an empty `values()` when no features are declared (rust-lang/cargo#13316) - fix(`--package`): accept `?` if it's a valid pkgid spec (rust-lang/cargo#13315) r? ghost
Update cargo 10 commits in 1ae631085f01c1a72d05df1ec81f3759a8360042..7bb7b539558dc88bea44cee4168b6269bf8177b0 2024-01-17 17:26:41 +0000 to 2024-01-20 00:15:32 +0000 - feat: inherit jobserver from env for all kinds of runner (rust-lang/cargo#12776) - Fix static_mut_ref warning. (rust-lang/cargo#13329) - fix(trim-paths): remap common prefix only (rust-lang/cargo#13210) - fix(cargo-rustdoc): use same path by output format logic everywhere (rust-lang/cargo#13325) - chore: Make MSRV=N-2 the workspace default (rust-lang/cargo#13324) - Fix precise-prerelease tracking link. (rust-lang/cargo#13320) - test(pkgid): keep package ID format in sync (rust-lang/cargo#13322) - Improve GitHub Actions CI config (rust-lang/cargo#13317) - Go back to passing an empty `values()` when no features are declared (rust-lang/cargo#13316) - fix(`--package`): accept `?` if it's a valid pkgid spec (rust-lang/cargo#13315) r? ghost
Update cargo 10 commits in 1ae631085f01c1a72d05df1ec81f3759a8360042..7bb7b539558dc88bea44cee4168b6269bf8177b0 2024-01-17 17:26:41 +0000 to 2024-01-20 00:15:32 +0000 - feat: inherit jobserver from env for all kinds of runner (rust-lang/cargo#12776) - Fix static_mut_ref warning. (rust-lang/cargo#13329) - fix(trim-paths): remap common prefix only (rust-lang/cargo#13210) - fix(cargo-rustdoc): use same path by output format logic everywhere (rust-lang/cargo#13325) - chore: Make MSRV=N-2 the workspace default (rust-lang/cargo#13324) - Fix precise-prerelease tracking link. (rust-lang/cargo#13320) - test(pkgid): keep package ID format in sync (rust-lang/cargo#13322) - Improve GitHub Actions CI config (rust-lang/cargo#13317) - Go back to passing an empty `values()` when no features are declared (rust-lang/cargo#13316) - fix(`--package`): accept `?` if it's a valid pkgid spec (rust-lang/cargo#13315) r? ghost
This pull request improves Cargo CI by:
By making all the jobs run only if triggered from this repository (to avoid having forks unnecessarily run CI jobs)By making all the checkouts takefetch-depth: 2
like done in rust-lang/rust (to avoid unnecessary work, saves bandwidth and maybe a bit of time)refs/heads/try
in thesuccess
andfailure
bors job gates (to fixbors try
from timing out)The main motivation for this PR was (at first) to make the CI jobs not run on forks since it's a waste of CI resources as well as always failing (like this); but after looking at the
main.yml
config I took the opportunity to improve the situation by using rust-lang/rust ci.yml as reference.