From fa847e028f56f19ea23956c74c7bc26f4fbad573 Mon Sep 17 00:00:00 2001 From: ApsisRS contributors Date: Sat, 26 Sep 2026 22:54:43 +0800 Subject: [PATCH] ci: fix the dependency freedom check --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9fdeef..47aa942 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,18 @@ jobs: run: cargo test --workspace - name: Verify dependency freedom run: | - if cargo tree --workspace --edges normal,build 2>/dev/null | grep -v '^apsis' | grep -q '('; then - echo "unexpected external dependency detected" >&2 + # Every package in the graph must be a workspace crate. `--prefix + # none` prints bare `name version` lines, one per package, which the + # box drawing prefix of the default format would otherwise hide. + external=$(cargo tree --workspace --all-features \ + --edges normal,build,dev --prefix none 2>/dev/null \ + | sed -E 's/ \(\*\)$//; s/ \([^)]*\)$//' \ + | awk 'NF {print $1}' \ + | sort -u \ + | grep -v '^apsis' || true) + if [ -n "$external" ]; then + echo "unexpected external dependency detected:" >&2 + echo "$external" >&2 exit 1 fi + echo "dependency check passed: workspace crates only"