Skip to content

Commit cc9f3be

Browse files
committed
Add CI job checking for duplicate dependencies
Add a CI job that checks for duplicate dependencies, i.e., those pulled in in multiple versions. Signed-off-by: Daniel Müller <[email protected]>
1 parent 934ea1f commit cc9f3be

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,19 @@ jobs:
518518
CGO_CFLAGS: "-I${{ github.workspace }}/capi/include"
519519
# Tests are compiled first to include debug info, which is skipped in regular `go test`.
520520
- run: cd go && CGO_CFLAGS="-I$(pwd)/../capi/include" CGO_LDFLAGS="-L$(pwd)/../target/debug" go test -v -c -o /tmp/test . && LD_LIBRARY_PATH=$(pwd)/../target/debug /tmp/test -test.v
521+
deps:
522+
name: Check for duplicate dependencies
523+
runs-on: ubuntu-latest
524+
steps:
525+
- uses: actions/checkout@v6
526+
- uses: dtolnay/rust-toolchain@stable
527+
- shell: bash
528+
run: |
529+
out=$(cargo tree --quiet --duplicates --edges normal 2> /dev/null)
530+
if [ -n "$out" ]; then
531+
echo -e "duplicate dependencies found:\n${out}"
532+
exit 1
533+
fi
521534
522535
required-checks:
523536
needs: [
@@ -535,6 +548,7 @@ jobs:
535548
rustfmt,
536549
cargo-doc,
537550
go,
551+
deps,
538552
]
539553
if: always()
540554
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)