Skip to content

Commit 1ea960a

Browse files
committed
ci: add observable final issue 974 verification
1 parent 8a8c7cb commit 1ea960a

1 file changed

Lines changed: 132 additions & 0 deletions

File tree

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Observable final issue 974 verification
2+
3+
on:
4+
push:
5+
branches:
6+
- feat/issue-974-client-response-cache
7+
paths:
8+
- .github/workflows/final-issue-974-marker.yml
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
verify:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 240
17+
steps:
18+
- name: Check out implementation branch
19+
uses: actions/checkout@v7
20+
with:
21+
ref: feat/issue-974-client-response-cache
22+
fetch-depth: 0
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v6
26+
with:
27+
node-version: '22'
28+
29+
- name: Set up uv
30+
uses: astral-sh/setup-uv@v7
31+
32+
- name: Set up Python environment
33+
run: |
34+
uv python install
35+
uv venv
36+
37+
- name: Install stable Rust
38+
uses: dtolnay/rust-toolchain@stable
39+
with:
40+
components: clippy, llvm-tools-preview
41+
42+
- name: Install nightly Rust and rustfmt
43+
run: rustup toolchain install nightly --component rustfmt
44+
45+
- name: Install CI tools
46+
uses: taiki-e/install-action@v2
47+
with:
48+
tool: cargo-audit,cargo-semver-checks,cargo-public-api,cargo-llvm-cov,typos-cli
49+
50+
- name: Install WASI target
51+
run: rustup target add wasm32-wasip2
52+
53+
- name: Fetch and verify upstream main
54+
run: |
55+
git remote add upstream https://github.com/modelcontextprotocol/rust-sdk.git
56+
git fetch upstream main
57+
test "$(git rev-parse origin/main)" = "$(git rev-parse upstream/main)"
58+
59+
- name: Restore the clean review branch
60+
run: |
61+
git rm -f .github/workflows/final-issue-974-marker.yml
62+
cargo +nightly fmt --all
63+
git diff --check
64+
git add -A
65+
git reset --soft upstream/main
66+
git config user.name "John-Francis Nnadi"
67+
git config user.email "nnadifrancis23@gmail.com"
68+
git commit -m "feat(client): add SEP-2549 response caching"
69+
git push --force-with-lease origin HEAD:feat/issue-974-client-response-cache
70+
71+
- name: Verify commit convention
72+
run: |
73+
npm install --no-save --no-package-lock @commitlint/cli @commitlint/config-conventional
74+
printf "module.exports = {extends: ['@commitlint/config-conventional']};\n" > commitlint.config.cjs
75+
npx commitlint --config ./commitlint.config.cjs --from upstream/main --to HEAD --verbose
76+
77+
- name: Verify formatting, linting, and spelling
78+
run: |
79+
cargo +nightly fmt --all -- --check
80+
git diff --check upstream/main...HEAD
81+
cargo clippy --all-targets --all-features -- -D warnings
82+
typos
83+
84+
- name: Run repository and issue tests
85+
shell: bash
86+
run: |
87+
FEATURES=$(cargo metadata --no-deps --format-version 1 | jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[] | select(startswith("__") | not) | select(. != "local")] | join(",")')
88+
test -n "$FEATURES"
89+
90+
cargo test --all-features
91+
cargo test -p rmcp --features "$FEATURES"
92+
cargo test -p rmcp --all-features service::client::tests -- --nocapture
93+
cargo test -p rmcp --all-features --test test_tool_disable_notification -- --nocapture
94+
cargo test -p rmcp --all-features --test test_cache_hints -- --nocapture
95+
cargo test -p rmcp --doc --all-features
96+
cargo test --manifest-path conformance/Cargo.toml --all-features
97+
98+
- name: Verify API compatibility and coverage
99+
shell: bash
100+
run: |
101+
FEATURES=$(cargo metadata --no-deps --format-version 1 | jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[] | select(startswith("__") | not) | select(. != "local")] | join(",")')
102+
103+
cargo semver-checks --package rmcp --baseline-rev upstream/main --release-type minor --only-explicit-features --features default
104+
cargo semver-checks --package rmcp --baseline-rev upstream/main --release-type minor --only-explicit-features --features "$FEATURES"
105+
cargo public-api --package rmcp -ss diff --deny changed --deny removed --force upstream/main..HEAD
106+
cargo public-api --package rmcp --features "$FEATURES" -ss diff --deny changed --deny removed --force upstream/main..HEAD
107+
cargo llvm-cov -p rmcp --all-features --no-report
108+
109+
- name: Run security and documentation checks
110+
run: |
111+
cargo audit
112+
RUSTDOCFLAGS='--cfg docsrs -Dwarnings' cargo +nightly doc --no-deps -p rmcp -p rmcp-macros --all-features
113+
114+
- name: Build and test examples
115+
shell: bash
116+
run: |
117+
for dir in examples/*/; do
118+
if [ -f "$dir/Cargo.toml" ]; then
119+
if [[ "$dir" == *"wasi"* ]]; then
120+
cargo build --manifest-path "$dir/Cargo.toml" --target wasm32-wasip2
121+
else
122+
cargo build --manifest-path "$dir/Cargo.toml" --all-features --tests
123+
cargo test --manifest-path "$dir/Cargo.toml" --all-features --all-targets
124+
fi
125+
fi
126+
done
127+
128+
- name: Publish verified marker
129+
run: |
130+
git commit --allow-empty -m "ci: verify issue 974 final branch"
131+
npx commitlint --config ./commitlint.config.cjs --from upstream/main --to HEAD --verbose
132+
git push origin HEAD:feat/issue-974-client-response-cache

0 commit comments

Comments
 (0)