Skip to content

Commit

Permalink
chore: add script to check for critical library
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Dec 4, 2024
1 parent f81244c commit 91c5432
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CRITICAL_NOIR_LIBRARIES
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
https://github.com/noir-lang/ec
https://github.com/noir-lang/eddsa
https://github.com/noir-lang/mimc
https://github.com/noir-lang/schnorr
https://github.com/noir-lang/noir_sort
https://github.com/noir-lang/noir-edwards
https://github.com/noir-lang/noir-bignum
https://github.com/noir-lang/noir_bigcurve
https://github.com/noir-lang/noir_base64
https://github.com/noir-lang/noir_string_search
https://github.com/noir-lang/sparse_array
https://github.com/noir-lang/noir_rsa
30 changes: 30 additions & 0 deletions scripts/check-critical-libraries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e

# Run relative to repo root
cd $(dirname "$0")/../

CRITICAL_LIBRARIES=$(grep -v "^#\|^$" ./CRITICAL_NOIR_LIBRARIES)
readarray -t REPOS_TO_CHECK < <(echo "$CRITICAL_LIBRARIES")

getLatestReleaseTagForRepo() {
REPO_NAME=$1
TAG=$(gh release list -R $REPO_NAME --json 'tagName,isLatest' -q '.[] | select(.isLatest == true).tagName')
if [[ -z $TAG ]]; then
echo "$REPO_NAME has no valid release" >&2
exit 1
fi
echo $TAG
}

for REPO in ${REPOS_TO_CHECK[@]}; do
echo $REPO
TMP_DIR=$(mktemp -d)

TAG=$(getLatestReleaseTagForRepo $REPO)
git clone $REPO -c advice.detachedHead=false --depth 1 --branch $TAG $TMP_DIR

nargo test --program-dir $TMP_DIR

rm -rf $TMP_DIR
done

0 comments on commit 91c5432

Please sign in to comment.