bevy
bevy copied to clipboard
Check docs.rs metadata in CI
Objective
- I have a list of unstable rustdoc features that I play to start enabling.
- These features need to be enabled in the
[package.metadata.docs.rs]
table of all crates that use them, as well as in CI (see #13173 for related work). - CI can be used to ensure that these fields are consistent for all crates.
Solution
- Create
check_docsrs_metadata.sh
, which verifies that all public crates have the correct metadata usingcargo metadata
. - Run this script in CI.
- Make all crates scrape examples, to be consistent with the main
bevy
crate.- This isn't fantastic because most crates don't have their own examples, but I find this preferable over excluding the main
bevy
crate from checks.
- This isn't fantastic because most crates don't have their own examples, but I find this preferable over excluding the main
Testing
- Run
./tools/check_docsrs_metadata.sh
locally. It should either pass or give an error message for all invalid crates. - The CI check should pass.
Further Questions
- Should this check be always run, only run when
Cargo.toml
is modified (thinkdependencies.yml
), or only in the merge queue?
Changelog
-
[package.metadata.docs.rs]
for all public crates is now verified in CI.
We re trying to avoid shellscripts to be cross platform. Could you add it to the ci rust script?
We re trying to avoid shellscripts to be cross platform. Could you add it to the ci rust script?
Not easily right now. Our current ci
structure does not support running generic functions, but instead requires everything to be an xshell::Cmd
. @Brezak and I are both working on improving this, but that's a few steps away.
When we do finish it, this will be one of the first things ported. (publish.sh
is another potential candidate.)
Speaking of which: #13279.