Skip to content

Commit

Permalink
Match CI doc testing with docs.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xStrom committed Nov 5, 2024
1 parent edfdb30 commit 42cd690
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,17 @@ jobs:
with:
save-if: ${{ github.event_name != 'merge_group' }}

# We test documentation using nightly to match docs.rs. This prevents potential breakages
# We test documentation using nightly to match docs.rs.
- name: cargo doc
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: '--cfg docsrs -D warnings'

# If this fails, consider changing your text or adding something to .typos.toml
# If this fails, consider changing your text or adding something to .typos.toml.
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: check typos
uses: crate-ci/typos@v1.26.0
uses: crate-ci/typos@v1.27.0
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ readme = "README.md"
# and with the MSRV in the `Unreleased` section of CHANGELOG.md.
rust-version = "1.70"

[package.metadata.docs.rs]
all-features = true
# There are no platform specific docs.
default-target = "x86_64-unknown-linux-gnu"
targets = []

[features]
default = ["std"]
std = ["kurbo/std"]
libm = ["kurbo/libm"]
mint = ["kurbo/mint"]
serde = ["smallvec/serde", "kurbo/serde", "dep:serde_bytes", "dep:serde"]

[package.metadata.docs.rs]
features = ["serde"]

[dependencies]
# NOTE: Make sure to keep this in sync with the version badge in README.md
kurbo = { version = "0.11.1", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//! [`kurbo`]: https://crates.io/crates/kurbo

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(unused_crate_dependencies)]
#![warn(clippy::print_stdout, clippy::print_stderr)]
// There are lots of conversion to u8 color field, which in degenerate cases might not work
Expand Down

0 comments on commit 42cd690

Please sign in to comment.