Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add CI for Rust Docs #1313

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions protocols/v1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions protocols/v2/noise-sv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ panic = "unwind"

[profile.release]
panic = "abort"

[package.metadata.docs.rs]
features = ["std"]
2 changes: 1 addition & 1 deletion roles/roles-utils/network-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
features = ["with_buffer_pool", "with_tokio", "async_std"]
3 changes: 0 additions & 3 deletions roles/roles-utils/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions utils/bip32-key-derivation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions utils/error-handling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions utils/key-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading