diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42bbece15f..60da787ab9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,6 +216,7 @@ jobs: env: RUSTC_WRAPPER: "sccache" SCCACHE_GHA_ENABLED: "on" + RUSTDOCFLAGS: --cfg docsrs steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master @@ -226,8 +227,9 @@ jobs: - name: Docs run: cargo doc --workspace --all-features --no-deps --document-private-items - env: - RUSTDOCFLAGS: --cfg docsrs + + - name: Docs (default features) + run: cargo doc --workspace --no-deps clippy_check: timeout-minutes: 30 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ad8edd8984..9ef8b6b089 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -127,14 +127,25 @@ jobs: - name: doctests if: ${{ (! inputs.flaky) && matrix.features == 'all' }} + env: + RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG'}} run: | - if [ -n "${{ runner.debug }}" ]; then - export RUST_LOG=TRACE - else - export RUST_LOG=DEBUG - fi cargo test --workspace --all-features --doc + # We can not check the doctest features by only compiling them, + # so are forced to run them once more. + - name: Check doctest features + if: ${{ ! inputs.flaky }} + env: + RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG'}} + run: | + for i in ${CRATES_LIST//,/ } + do + echo "Checking $i doctest $FEATURES" + echo cargo test -p $i --doc $FEATURES + cargo test -p $i --doc $FEATURES + done + build_and_test_windows: timeout-minutes: 30 name: "Tests" diff --git a/iroh-relay/src/server.rs b/iroh-relay/src/server.rs index e30a7dbc03..671782d93c 100644 --- a/iroh-relay/src/server.rs +++ b/iroh-relay/src/server.rs @@ -138,8 +138,8 @@ pub struct QuicConfig { pub bind_addr: SocketAddr, /// The TLS server configuration for the QUIC server. /// - /// If this [`rustls::ServerConfig`] does not support - /// TLS 1.3, the QUIC server will fail at [`QuicServer::spawn`]. + /// If this [`rustls::ServerConfig`] does not support TLS 1.3, the QUIC server will fail + /// to spawn. pub server_config: rustls::ServerConfig, } diff --git a/iroh/src/discovery.rs b/iroh/src/discovery.rs index 450bd60f6d..805a6e65fe 100644 --- a/iroh/src/discovery.rs +++ b/iroh/src/discovery.rs @@ -30,9 +30,11 @@ //! //! - The [`PkarrResolver`] which can perform lookups from designated [pkarr relay servers] //! using HTTP. -//! -//! - The [`LocalSwarmDiscovery`] discovers iroh nodes present on the local network, -//! very similar to mdNS. +#![cfg_attr( + feature = "discovery-local-network", + doc = "- [`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery + very similar to mDNS." +)] //! //! - The [`DhtDiscovery`] also uses the [`pkarr`] system but can also publish and lookup //! records to/from the Mainline DHT. @@ -67,10 +69,18 @@ //! # } //! ``` //! -//! To also enable [`LocalSwarmDiscovery`], it can be added as another service in the +//! To also enable +#![cfg_attr(feature = "discovery-local-network", doc = "[`LocalSwarmDiscovery`]")] +#![cfg_attr( + not(feature = "discovery-local-network"), + doc = "`LocalSwarmDiscovery`" +)] +//! it can be added as another service in the //! [`ConcurrentDiscovery`]: //! //! ```no_run +//! # #[cfg(feature = "discovery-local-network")] +//! # { //! # use iroh::discovery::dns::DnsDiscovery; //! # use iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery; //! # use iroh::discovery::pkarr::PkarrPublisher; @@ -86,6 +96,7 @@ //! ]); //! # Ok(()) //! # } +//! # } //! ``` //! //! [`RelayUrl`]: crate::relay::RelayUrl @@ -94,9 +105,12 @@ //! [Number 0]: https://n0.computer //! [`PkarrResolver`]: pkarr::PkarrResolver //! [`PkarrPublisher`]: pkarr::PkarrPublisher -//! [`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery //! [`DhtDiscovery`]: pkarr::dht::DhtDiscovery //! [pkarr relay servers]: https://pkarr.org/#servers +#![cfg_attr( + feature = "discovery-local-network", + doc = "[`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery" +)] use std::time::Duration;