Improve test coverage for docs build
Currently the docs build commands in `hashes` and `bitcoin` differ, they should be the same. Add a command `cargo doc` to improve coverage e.g., recently we botched the feature guarding but since CI only runs `cargo rustdoc` with custom compiler conditional set we didn't catch it. Run docs in CI using nightly and stable toolchains as required.
This commit is contained in:
parent
b4c14a4b7c
commit
41f2dcf6ae
|
@ -20,6 +20,7 @@ jobs:
|
||||||
DO_LINT: true
|
DO_LINT: true
|
||||||
AS_DEPENDENCY: false
|
AS_DEPENDENCY: false
|
||||||
DO_NO_STD: true
|
DO_NO_STD: true
|
||||||
|
DO_DOCS: true
|
||||||
DO_FEATURE_MATRIX: true
|
DO_FEATURE_MATRIX: true
|
||||||
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
|
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
|
||||||
run: ./contrib/test.sh
|
run: ./contrib/test.sh
|
||||||
|
@ -55,7 +56,7 @@ jobs:
|
||||||
DO_BENCH: true
|
DO_BENCH: true
|
||||||
AS_DEPENDENCY: false
|
AS_DEPENDENCY: false
|
||||||
DO_NO_STD: true
|
DO_NO_STD: true
|
||||||
DO_DOCS: true
|
DO_DOCSRS: true
|
||||||
run: ./contrib/test.sh
|
run: ./contrib/test.sh
|
||||||
|
|
||||||
MSRV:
|
MSRV:
|
||||||
|
|
|
@ -80,8 +80,14 @@ cargo run --example ecdsa-psbt --features=bitcoinconsensus
|
||||||
cargo run --example taproot-psbt --features=rand-std,bitcoinconsensus
|
cargo run --example taproot-psbt --features=rand-std,bitcoinconsensus
|
||||||
|
|
||||||
# Build the docs if told to (this only works with the nightly toolchain)
|
# 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
|
if [ "$DO_DOCS" = true ]; then
|
||||||
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links -D warnings
|
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fuzz if told to
|
# Fuzz if told to
|
||||||
|
|
|
@ -57,8 +57,14 @@ if [ "$DO_SCHEMARS_TESTS" = true ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build the docs if told to (this only works with the nightly toolchain)
|
# 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
|
if [ "$DO_DOCS" = true ]; then
|
||||||
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features="$FEATURES"
|
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Webassembly stuff
|
# Webassembly stuff
|
||||||
|
|
Loading…
Reference in New Issue