Skip to content

Commit 0e2006e

Browse files
committed
Add a docs.rs CI job checking documentation builds
We previouly ran into a quiet error that lead to `docs.rs` not rendering our docs properly, which unfortunately didn't surface until after we pushed out a releas (thankfully only an RC in this case). Here, we add a CI job that tests our docs build with exactly the settings `docs.rs` uses. Additionally, the change also has the benefit that we now only build docs once rather than for every combiantion in our workflow matrix, which was a bit overkill.
1 parent 37045f4 commit 0e2006e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/rust.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ jobs:
7272
- name: Build with UniFFI support on Rust ${{ matrix.toolchain }}
7373
if: matrix.build-uniffi
7474
run: cargo build --features uniffi --verbose --color always
75-
- name: Build documentation on Rust ${{ matrix.toolchain }}
76-
if: "matrix.platform != 'windows-latest' || matrix.toolchain != '1.85.0'"
77-
run: |
78-
cargo doc --release --verbose --color always
79-
cargo doc --document-private-items --verbose --color always
8075
- name: Check release build on Rust ${{ matrix.toolchain }}
8176
run: cargo check --release --verbose --color always
8277
- name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }}
@@ -90,3 +85,14 @@ jobs:
9085
if: "matrix.platform != 'windows-latest' && matrix.build-uniffi"
9186
run: |
9287
RUSTFLAGS="--cfg no_download" cargo test --features uniffi
88+
89+
doc:
90+
name: Documentation
91+
runs-on: ubuntu-latest
92+
env:
93+
RUSTDOCFLAGS: -Dwarnings
94+
steps:
95+
- uses: actions/checkout@v6
96+
- uses: dtolnay/rust-toolchain@nightly
97+
- uses: dtolnay/install@cargo-docs-rs
98+
- run: cargo docs-rs

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ readme = "README.md"
1212
keywords = ["bitcoin", "lightning", "ldk", "bdk"]
1313
categories = ["cryptography::cryptocurrencies"]
1414

15-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
[package.metadata.docs.rs]
16+
features = ["uniffi"]
1617

1718
[lib]
1819
crate-type = ["lib", "staticlib", "cdylib"]

0 commit comments

Comments
 (0)