Skip to content

Commit

Permalink
Improve docs.rs config, add doc CI check.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Nov 7, 2024
1 parent dbeec5e commit 00a9020
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,20 @@ jobs:
with:
components: miri
- run: cargo miri test

doc:
name: cargo doc
# NOTE: We don't have any platform specific docs in this workspace, so we only run on Ubuntu.
# If we get per-platform docs (win/macos/linux/wasm32/..) then doc jobs should match that.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

# We test documentation using nightly to match docs.rs.
- name: cargo doc
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: '--cfg docsrs -D warnings'
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ repository = "https://github.com/dfrg/swash"
homepage = "https://github.com/dfrg/swash"
readme = "README.md"

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

[features]
default = ["std", "scale", "render"]

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ the respective modules.
#![allow(clippy::needless_lifetimes)]
#![allow(clippy::redundant_static_lifetimes)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(any(test, feature = "std")), no_std)]
extern crate alloc;

Expand Down

0 comments on commit 00a9020

Please sign in to comment.