diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2b04fa9c..067ee137 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,6 +20,7 @@ jobs: DO_LINT: true AS_DEPENDENCY: false DO_NO_STD: true + DO_DOCS: true DO_FEATURE_MATRIX: true DO_SCHEMARS_TESTS: true # Currently only used in hashes crate. run: ./contrib/test.sh @@ -55,7 +56,7 @@ jobs: DO_BENCH: true AS_DEPENDENCY: false DO_NO_STD: true - DO_DOCS: true + DO_DOCSRS: true run: ./contrib/test.sh MSRV: diff --git a/bitcoin/contrib/test.sh b/bitcoin/contrib/test.sh index efee8bf8..4657f0aa 100755 --- a/bitcoin/contrib/test.sh +++ b/bitcoin/contrib/test.sh @@ -80,8 +80,14 @@ cargo run --example ecdsa-psbt --features=bitcoinconsensus cargo run --example taproot-psbt --features=rand-std,bitcoinconsensus # Build the docs if told to (this only works with the nightly toolchain) +if [ "$DO_DOCSRS" = true ]; then + RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features +fi + +# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command +# above this checks that we feature guarded docs imports correctly. if [ "$DO_DOCS" = true ]; then - RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links -D warnings || exit 1 + RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features fi # Fuzz if told to diff --git a/hashes/contrib/test.sh b/hashes/contrib/test.sh index 68423c36..f5c0a659 100755 --- a/hashes/contrib/test.sh +++ b/hashes/contrib/test.sh @@ -57,8 +57,14 @@ if [ "$DO_SCHEMARS_TESTS" = true ]; then fi # Build the docs if told to (this only works with the nightly toolchain) +if [ "$DO_DOCSRS" = true ]; then + RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features +fi + +# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command +# above this checks that we feature guarded docs imports correctly. if [ "$DO_DOCS" = true ]; then - RUSTDOCFLAGS="--cfg docsrs" cargo doc --features="$FEATURES" + RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features fi # Webassembly stuff