diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 000000000..13145058c --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,111 @@ +# Enforces Rust Docs sanity (protocols crates only) +# If `cargo doc --all-features` fails for one crate, the entire workflow fails + +name: Rust Docs + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + cargo-doc-all-features: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Rust Docs crate common + run: | + cd common + cargo doc + + - name: Rust Docs crate buffer_sv2 + run: | + cd utils/buffer + cargo doc + + - name: Rust Docs crate no_serde_sv2_derive_codec + run: | + cd protocols/v2/binary-sv2/no-serde-sv2/derive_codec + cargo doc + + - name: Rust Docs crate no_serde_sv2_codec + run: | + cd protocols/v2/binary-sv2/no-serde-sv2/codec + cargo doc --features with_buffer_pool + + - name: Rust Docs crate serde_sv2 + run: | + cd protocols/v2/binary-sv2/serde-sv2 + cargo doc + + - name: Rust Docs crate binary_sv2 + run: | + cd protocols/v2/binary-sv2/binary-sv2 + cargo doc --features core,with_buffer_pool + + - name: Rust Docs crate const_sv2 + run: | + cd protocols/v2/const-sv2 + cargo doc + + - name: Rust Docs crate framing_sv2 + run: | + cd protocols/v2/framing-sv2 + cargo doc --features with_buffer_pool + + - name: Rust Docs crate noise_sv2 + run: | + cd protocols/v2/noise-sv2 + cargo doc --features std + + - name: Rust Docs crate codec_sv2 + run: | + cd protocols/v2/codec-sv2 + cargo doc --features with_buffer_pool,noise_sv2 + + - name: Rust Docs crate common_messages + run: | + cd protocols/v2/subprotocols/common-messages + cargo doc + + - name: Rust Docs crate job_declaration + run: | + cd protocols/v2/subprotocols/job-declaration + cargo doc --all-features + + - name: Rust Docs crate mining + run: | + cd protocols/v2/subprotocols/mining + cargo doc --all-features + + - name: Rust Docs crate template_distribution + run: | + cd protocols/v2/subprotocols/template-distribution + cargo doc + + - name: Rust Docs crate sv2_ffi + run: | + cd protocols/v2/sv2-ffi + cargo doc + + - name: Rust Docs crate roles_logic_sv2 + + run: | + cd protocols/v2/roles-logic-sv2 + cargo doc + + - name: Rust Docs crate sv1_api + run: | + cd protocols/v1 + cargo doc \ No newline at end of file diff --git a/common/Cargo.toml b/common/Cargo.toml index b2a01f0ec..3b9d7cc2c 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -9,6 +9,3 @@ repository = "https://github.com/stratum-mining/stratum" [dependencies] bitcoin = {version="0.29.1",optional=true} secp256k1 = { version = "0.28.2", default-features = false, features =["alloc","rand","rand-std"] } - -[package.metadata.docs.rs] -all-features = true \ No newline at end of file diff --git a/protocols/v1/Cargo.toml b/protocols/v1/Cargo.toml index a983e6748..b8783a467 100644 --- a/protocols/v1/Cargo.toml +++ b/protocols/v1/Cargo.toml @@ -25,6 +25,3 @@ binary_sv2 = { version = "^1.0.0", path = "../v2/binary-sv2/binary-sv2"} [dev-dependencies] quickcheck = "1" quickcheck_macros = "1" - -[package.metadata.docs.rs] -all-features = true diff --git a/protocols/v2/noise-sv2/Cargo.toml b/protocols/v2/noise-sv2/Cargo.toml index dc72101a7..52724e1de 100644 --- a/protocols/v2/noise-sv2/Cargo.toml +++ b/protocols/v2/noise-sv2/Cargo.toml @@ -33,3 +33,6 @@ panic = "unwind" [profile.release] panic = "abort" + +[package.metadata.docs.rs] +features = ["std"] diff --git a/roles/roles-utils/network-helpers/Cargo.toml b/roles/roles-utils/network-helpers/Cargo.toml index 1a39669d3..6308250fb 100644 --- a/roles/roles-utils/network-helpers/Cargo.toml +++ b/roles/roles-utils/network-helpers/Cargo.toml @@ -32,4 +32,4 @@ with_serde = ["binary_sv2/with_serde", "serde", "codec_sv2/with_serde"] with_buffer_pool = ["codec_sv2/with_buffer_pool"] [package.metadata.docs.rs] -all-features = true \ No newline at end of file +features = ["with_buffer_pool", "with_tokio", "async_std"] \ No newline at end of file diff --git a/roles/roles-utils/rpc/Cargo.toml b/roles/roles-utils/rpc/Cargo.toml index 129354cdb..4f5a1bd28 100644 --- a/roles/roles-utils/rpc/Cargo.toml +++ b/roles/roles-utils/rpc/Cargo.toml @@ -22,6 +22,3 @@ base64 = "0.21.5" hyper = { version = "1.1.0", features = ["full"] } hyper-util = { version = "0.1", features = ["full"] } http-body-util = "0.1" - -[package.metadata.docs.rs] -all-features = true \ No newline at end of file diff --git a/utils/bip32-key-derivation/Cargo.toml b/utils/bip32-key-derivation/Cargo.toml index 2bcdd6fe1..b9424dd5b 100644 --- a/utils/bip32-key-derivation/Cargo.toml +++ b/utils/bip32-key-derivation/Cargo.toml @@ -25,6 +25,3 @@ slip132 = "0.10" [dev-dependencies] toml = { version = "0.5.6", git = "https://github.com/diondokter/toml-rs", default-features = false, rev = "c4161aa" } - -[package.metadata.docs.rs] -all-features = true \ No newline at end of file diff --git a/utils/error-handling/Cargo.toml b/utils/error-handling/Cargo.toml index 1999d7bcb..67baf94cd 100644 --- a/utils/error-handling/Cargo.toml +++ b/utils/error-handling/Cargo.toml @@ -9,6 +9,3 @@ homepage = "https://stratumprotocol.org" repository = "https://github.com/stratum-mining/stratum" license = "MIT OR Apache-2.0" keywords = ["stratum", "mining", "bitcoin", "protocol"] - -[package.metadata.docs.rs] -all-features = true \ No newline at end of file diff --git a/utils/key-utils/Cargo.toml b/utils/key-utils/Cargo.toml index 7d0213bba..428f700c1 100644 --- a/utils/key-utils/Cargo.toml +++ b/utils/key-utils/Cargo.toml @@ -29,6 +29,3 @@ serde = { version = "1.0.89", features = ["derive","alloc"], default-features = [dev-dependencies] toml = { version = "0.5.6", git = "https://github.com/diondokter/toml-rs", default-features = false, rev = "c4161aa" } - -[package.metadata.docs.rs] -all-features = true \ No newline at end of file