diff --git a/.github/scripts/check-workspace.py b/.github/scripts/check-workspace.py index fb3b53acb0..d200122fee 100644 --- a/.github/scripts/check-workspace.py +++ b/.github/scripts/check-workspace.py @@ -27,6 +27,7 @@ def main(root, exclude): all_crates = get_crates(root, exclude) print(f'📦 Found {len(all_crates)} crates in total') + check_duplicates(workspace_crates) check_missing(workspace_crates, all_crates) check_links(all_crates) @@ -89,6 +90,16 @@ def get_crates(workspace_dir, exclude_crates) -> dict: return crates +# Check that there are no duplicate entries in the workspace. +def check_duplicates(workspace_crates): + print(f'🔎 Checking for duplicate crates') + found = {} + for path in workspace_crates: + if path in found: + print(f'❌ crate is listed twice in the workspace {path}') + sys.exit(1) + found[path] = True + # Check that all crates are in the workspace. def check_missing(workspace_crates, all_crates): print(f'🔎 Checking for missing crates') diff --git a/Cargo.toml b/Cargo.toml index fd8708a3da..20cc16039f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -175,7 +175,6 @@ members = [ "polkadot/node/service", "polkadot/node/subsystem", "polkadot/node/subsystem-bench", - "polkadot/node/subsystem-bench", "polkadot/node/subsystem-test-helpers", "polkadot/node/subsystem-types", "polkadot/node/subsystem-util",