From 8d312eb521c3ca121a02942505f597da2f4a0761 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 24 Nov 2025 10:14:26 +0100 Subject: [PATCH] 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. --- .github/workflows/rust.yml | 16 +++++++++++----- Cargo.toml | 2 -- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 87249bd72..661703ded 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -72,11 +72,6 @@ jobs: - name: Build with UniFFI support on Rust ${{ matrix.toolchain }} if: matrix.build-uniffi run: cargo build --features uniffi --verbose --color always - - name: Build documentation on Rust ${{ matrix.toolchain }} - if: "matrix.platform != 'windows-latest' || matrix.toolchain != '1.85.0'" - run: | - cargo doc --release --verbose --color always - cargo doc --document-private-items --verbose --color always - name: Check release build on Rust ${{ matrix.toolchain }} run: cargo check --release --verbose --color always - name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }} @@ -90,3 +85,14 @@ jobs: if: "matrix.platform != 'windows-latest' && matrix.build-uniffi" run: | RUSTFLAGS="--cfg no_download" cargo test --features uniffi + + doc: + name: Documentation + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -Dwarnings + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/install@cargo-docs-rs + - run: cargo docs-rs diff --git a/Cargo.toml b/Cargo.toml index 5df9b3309..608ae439d 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,6 @@ readme = "README.md" keywords = ["bitcoin", "lightning", "ldk", "bdk"] categories = ["cryptography::cryptocurrencies"] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["lib", "staticlib", "cdylib"] name = "ldk_node"