diff --git a/.circleci/config.yml b/.circleci/config.yml index bb420c5da89..00a0f586c85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,6 +18,7 @@ version: 2.1 orbs: slack: circleci/slack@4.12.1 + gh: circleci/github-cli@2.0 parameters: workflow: @@ -246,6 +247,8 @@ jobs: steps: - *checkout - *setup_env + - gh/setup: + token: $AZTEC_BOT_COMMENTER_GITHUB_TOKEN - run: name: "Build and test" command: cond_spot_run_build barretenberg-acir-tests-bb 32 @@ -279,6 +282,8 @@ jobs: steps: - *checkout - *setup_env + - gh/setup: + token: $AZTEC_BOT_COMMENTER_GITHUB_TOKEN - run: name: "Build and test" command: cond_spot_run_build barretenberg-acir-tests-bb.js 32 diff --git a/barretenberg/acir_tests/run_acir_tests.sh b/barretenberg/acir_tests/run_acir_tests.sh index 6121588d391..5ca95261cc7 100755 --- a/barretenberg/acir_tests/run_acir_tests.sh +++ b/barretenberg/acir_tests/run_acir_tests.sh @@ -7,7 +7,8 @@ set -eu BIN=${BIN:-../cpp/build/bin/bb} FLOW=${FLOW:-prove_and_verify} CRS_PATH=~/.bb-crs -BRANCH=master +NOIR_REPO="https://github.com/noir-lang/noir.git" +BRANCH=tf/acir-artifact VERBOSE=${VERBOSE:-} TEST_NAMES=("$@") @@ -26,15 +27,22 @@ if [ ! -d acir_tests ]; then if [ -n "${TEST_SRC:-}" ]; then cp -R $TEST_SRC acir_tests else - rm -rf noir - git clone -b $BRANCH --filter=blob:none --no-checkout https://github.com/noir-lang/noir.git - cd noir - git sparse-checkout init --cone - git sparse-checkout set tooling/nargo_cli/tests/acir_artifacts - git checkout - cd .. - mv noir/tooling/nargo_cli/tests/acir_artifacts acir_tests - rm -rf noir + # Search for successful workflow runs on the specified branch + WORKFLOW_RUNS=$(gh run list -b $BRANCH -w "Rebuild ACIR artifacts" --repo $NOIR_REPO --json databaseId --json conclusion) + WORKFLOW_RUNS=$(echo $WORKFLOW_RUNS | jq 'map(select(.conclusion == "success")) | map(.databaseId)' | jq @sh | xargs echo) + + # Iterate through workflow runs until we find one with ACIR artifacts + set +eu + for WORKFLOW_RUN in $WORKFLOW_RUNS; do + + echo "Checking workflow run $WORKFLOW_RUN" + gh run download $WORKFLOW_RUN --dir acir_tests --repo $NOIR_REPO -n acir-artifacts + if [[ $? -eq "0" ]]; then + break; + fi + done + set -eu + fi fi