Imitate the documentation build that docs.rs would do
APACHE-2.0 License
Run cargo rustdoc
with the same options that would be used by docs.rs, taking
into account the package.metadata.docs.rs
configured in Cargo.toml.
If the following GitHub Actions job succeeds, it's likely that docs.rs will succeed in building your crate's documentation.
# .github/workflows/ci.yml
name: test suite
on: [push, pull_request]
jobs:
# ...
doc:
name: Documentation
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs