-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Optimize CI caching and path filtering #2340
Conversation
# Conflicts: # .github/workflows/publish-examples.yml # .github/workflows/pull-request.yml # website/package-lock.json
move website test as a prerequisite for publish
writeln!(dst, "#[doc = include_str!(\"{}\")]", file.display())?; | ||
|
||
writeln!(dst, "#[doc = include_str!(r\"{}\")]", file.display())?; |
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.
this previously prevented these tests to be run on windows
:::note Extra Braces Required | ||
`sidebar = {{html_nested!{...}}}` appears to require one extra set of braces. | ||
This is unintuitive, and we will fix the behavior in a later release. | ||
::: |
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.
add notes on the website for #2267
This help check the correctness of the combined website workflow too
@voidpumpkin Why did the benchmark start for my PR anyways, when the PR doesn't have the label "performance", does this fail to filter? |
I think everything works as expected, except the weird benchmark workflow behavior which @voidpumpkin is going to redo anyways. I'll sleep on this PR and see if anything needs to be changed tomorrow 🛏️ |
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.
Very annoying to review like this so let's just run it and fix issues as they pop up.
Oh I absolutely hate the idea of keeping the cargo-sweep binary in the repository. There has to be a way around that? |
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.
Looks goof for me but I will wait for @siku2 to review as he know more whats up with our ci.
website/versioned_docs/version-0.19.0/concepts/components/children.mdx
Outdated
Show resolved
Hide resolved
cargo-sweep doesn't release binaries, the release build is only 5Mb. hmm an alternative is to publish our own releases of ci-tools I guess? If that pollutes the repository too much I guess then we can have a separate |
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.
Actually noticed some bigger problems, so let's not merge this just yet :)
Generally very happy with the changes though!
Yes it fails to filter. |
How about using the cache for this too? Makes it slightly more complicated to perform automatic updates but it's much less of a hassle than to set up a separate repository for it. |
Should be ready now |
Is |
Yes, there is a
Good point, separate PR? |
I agree it should be separate PR |
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.
I would approve, but @Madoshakalaka could you rebase?
on: | ||
pull_request: | ||
paths: | ||
- "**/*.rs" |
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.
Love this.
It inspired me to make actions that add labels that i have been adding manually. (They are needed for changelog generation)
…es and there can be #[doc(include("../some.md"))] in the code
# Conflicts: # Cargo.toml # website/docs/getting-started/build-a-sample-app.mdx
Please resolve the conflicts |
# Conflicts: # .github/workflows/build-website.yml
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.
oh wait why suspense extension became mdx
in this pr?
(keeping in mind #2353 )
@hamza1311 i think we could merge this in |
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.
If anything goes wrong, it can be fixed later
Can't merge because of @siku2's review... |
Per-job Caching
each job now has its own cache keys.
Previously all jobs have the same cache. This is mad inefficient.
Cache from the nightly toolchain doesn't help at all in the same job with the stable toolchain for example.
Also added missing npm caching for website-related workflows.
stale cache invalidation
cargo caches aggressively and leaves a lot of outdated dependencies in the cache.
cargo-sweep is introduced to detect and clean unvisited cache during each job.
Also added a manually-dispatchable weekly cron job to build the
cargo-sweep
binary and commit to theci/
directory.Path Filtering Workflows
Touching
website/**
now won't trigger irrelevant workspace tests.The same goes the other way around, touching other stuff won't trigger website workflows.edit: touching other stuff should trigger website tests because the snippets depend on them.
Combined Website building and publishingPreviously two workflows were set up sequentially to do the building and publishing. The artifact download and upload can take a minute and a huge chunch of complex steps are dedicated tosetting variables and communicating between the two workflows. They are now combined with a
job:needs
key to preserve the sequential nature.Remove check-examples job in the pull-request workflow
It is covered by a previous
clippy --all-targets
job and only increases build timeExtract cargo fmt job as workflow
It doesn't need any caching and can be completed concurrently as fast as possible instead of blocking the pull-request workflow.
Renaming
pull-request.yml
is renamed tomain-checks.yml
un-exclude
tool/website-test
I can't figure out the reasoning for excluding the package in the workspace. It would complicate caching setup so I included it and the tests pass smoothly locally. I'll see how it goes in the CI.
Fixes
#0000complaints about slow CI speedCI is tricky to get right, I expect this PR to go through some painful followup edits :D