Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: docs.rs build

on: [push, pull_request]

jobs:
docs:
name: docs.rs build
runs-on: ubuntu-latest
# Same image docs.rs uses, so missing system libraries surface here first.
container:
image: ghcr.io/rust-lang/crates-build-env/linux:latest
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install cargo-docs-rs
run: cargo install --locked cargo-docs-rs
- name: Build docs the way docs.rs does
run: cargo +nightly docs-rs -p libwebauthn
7 changes: 7 additions & 0 deletions libwebauthn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ resolver = "2"
name = "libwebauthn"
path = "src/lib.rs"

# docs.rs builds with default features only, which omits the NFC transport.
# Document it too. libnfc is not available in the docs.rs build environment, so
# the libnfc backend is left out and NFC is documented through the pcsc backend.
[package.metadata.docs.rs]
features = ["nfc-backend-pcsc"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = []
nfc = ["apdu-core", "apdu"]
Expand Down
Loading