Skip to content

Commit bdf9498

Browse files
committed
Add a CI check that num-bigint is not present as a dependency
Signed-off-by: maurges <[email protected]>
1 parent 24164dc commit bdf9498

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/rust.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,22 @@ jobs:
111111
cache-on-failure: "true"
112112
- name: Run tests
113113
run: |
114-
cargo test --release --no-default-features --features \
115-
std,hd-wallet,serde,state-machine,all-curves,hd-slip10,hd-stark,spof,insecure-assume-preimage-known,__internal_doctest,backend-rug
114+
# We can't set --all-features as that will set backend-num-bigint which overrides rug, so we list all features except that
115+
features=std,hd-wallet,serde,state-machine,all-curves,hd-slip10,hd-stark,spof,insecure-assume-preimage-known,__internal_doctest,backend-rug
116+
117+
# Check that num-bigint was not present as a dependency of fast-paillier
118+
found=$(cargo tree --no-default-features --features $features --no-dedupe |
119+
# In the output of cargo tree, find lines between fast-paillier,
120+
# which with this indentation means it was a top-level dependency,
121+
# until another top-level dependency, and in those lines grep for
122+
# num-bigint
123+
awk '/^├── fast-paillier/{p=1;next} /^[└├]/{p=0} p' | grep num-bigint -q || echo NOTFOUND)
124+
if [ NOTFOUND != "$found" ]; then
125+
echo "found num-bigint in dependencies of fast-paillier when the num-bigint backend should not be selected!"
126+
exit 1
127+
fi
128+
129+
cargo test --release --no-default-features --features $features
116130
117131
fmt:
118132
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)