Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add script to check for critical libraries supporting a given Noir version #6697

Merged
merged 14 commits into from
Dec 6, 2024
1 change: 1 addition & 0 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ jobs:
- { repo: noir-lang/noir_string_search, path: ./ }
- { repo: noir-lang/sparse_array, path: ./ }
- { repo: noir-lang/noir_rsa, path: ./lib }
- { repo: noir-lang/noir_json_parser, path: ./ }
- { repo: AztecProtocol/aztec-packages, path: ./noir-projects/aztec-nr }
- { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-contracts }
- { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/parity-lib }
Expand Down
13 changes: 13 additions & 0 deletions CRITICAL_NOIR_LIBRARIES
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
https://github.com/noir-lang/noir_json_parser
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
36 changes: 36 additions & 0 deletions scripts/check-critical-libraries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e

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

if [[ -z $1 ]]; then
echo "Must specify Noir release to test against" >&2
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi
noirup -v $1

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
Loading