Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ jobs:
- name: Run lib tests without default features
run: cargo test -p rmcp --lib --no-default-features

- name: Check published crates ship LICENSE
run: |
for crate in rmcp rmcp-macros; do
cargo package --list -p "$crate" | grep -qx LICENSE
done

test-no-local:
name: Run Tests (no local feature)
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp-macros/LICENSE
1 change: 1 addition & 0 deletions crates/rmcp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "rmcp"
exclude = ["tests/test_package_license.rs"]
license = { workspace = true }
version = { workspace = true }
edition = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp/LICENSE
28 changes: 28 additions & 0 deletions crates/rmcp/tests/test_package_license.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//! The published crates must ship the repository LICENSE (see #1335).
//! `cargo package` only picks up files inside the crate directory, so each
//! crate keeps a LICENSE symlink to the workspace root file.
Comment thread
DaleSeo marked this conversation as resolved.

use std::path::Path;

fn assert_crate_license(crate_dir: &Path) {
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
let expected = std::fs::read_to_string(root.join("LICENSE")).expect("root LICENSE");
let actual = std::fs::read_to_string(crate_dir.join("LICENSE"))
.unwrap_or_else(|e| panic!("{} has no LICENSE: {e}", crate_dir.display()));
assert_eq!(
actual,
expected,
"{}/LICENSE differs from root",
crate_dir.display()
);
}

#[test]
fn rmcp_crate_ships_license() {
assert_crate_license(Path::new(env!("CARGO_MANIFEST_DIR")));
}

#[test]
fn rmcp_macros_crate_ships_license() {
assert_crate_license(&Path::new(env!("CARGO_MANIFEST_DIR")).join("../rmcp-macros"));
}
Comment thread
DaleSeo marked this conversation as resolved.
Loading