Skip to content

Commit 3e95c9b

Browse files
jokemanfireEItanya
authored andcommitted
ci: add documentation generation job (modelcontextprotocol#59)
* ci: add documentation generation job 1. add doc ci in workflow 2. remove the readme in rmcp crate Signed-off-by: jokemanfire <[email protected]> * docs: fix doc test in README.md 1) fix doc test in readme 2) fix some fmt Signed-off-by: jokemanfire <[email protected]> --------- Signed-off-by: jokemanfire <[email protected]>
1 parent 881a38b commit 3e95c9b

File tree

4 files changed

+24
-187
lines changed

4 files changed

+24
-187
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ jobs:
9090
- name: Run tests
9191
run: cargo test --all-features
9292

93+
doc:
94+
name: Generate Documentation
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v3
98+
99+
- name: Install Rust
100+
uses: dtolnay/rust-toolchain@stable
101+
102+
- uses: Swatinem/rust-cache@v2
103+
104+
- name: Generate documentation
105+
run: |
106+
cargo doc --no-deps -p rmcp -p rmcp-macros
107+
env:
108+
RUSTDOCFLAGS: -Dwarnings
109+
93110
release:
94111
name: Release crates
95112
runs-on: ubuntu-latest

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ Start a client in one line:
2424
use rmcp::{ServiceExt, transport::TokioChildProcess};
2525
use tokio::process::Command;
2626

27-
let client = ().serve(
28-
TokioChildProcess::new(Command::new("npx").arg("-y").arg("@modelcontextprotocol/server-everything"))?
29-
).await?;
27+
#[tokio::main]
28+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
29+
let client = ().serve(
30+
TokioChildProcess::new(Command::new("npx").arg("-y").arg("@modelcontextprotocol/server-everything"))?
31+
).await?;
32+
Ok(())
33+
}
3034
```
3135

3236
#### 1. Build a transport

crates/rmcp/README.md

Lines changed: 0 additions & 183 deletions
This file was deleted.

crates/rmcp/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
21
mod error;
32
pub use error::Error;
43

0 commit comments

Comments
 (0)