From 854fae76ad26b4656835b7eb5ed0899411e04ad8 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 5 Feb 2025 00:06:09 +0000 Subject: [PATCH 1/5] chore: create a CI action to download nargo and add to path --- .github/actions/download-nargo/action.yml | 18 ++++ .github/workflows/formatting.yml | 13 +-- .github/workflows/reports.yml | 101 +++------------------- .github/workflows/test-js-packages.yml | 92 ++------------------ 4 files changed, 39 insertions(+), 185 deletions(-) create mode 100644 .github/actions/download-nargo/action.yml diff --git a/.github/actions/download-nargo/action.yml b/.github/actions/download-nargo/action.yml new file mode 100644 index 00000000000..01d4aa38db0 --- /dev/null +++ b/.github/actions/download-nargo/action.yml @@ -0,0 +1,18 @@ +name: Download Nargo +description: Downloads the nargo binary from an artifact and adds it to the path + +runs: + using: composite + steps: + - name: Download nargo binary + uses: actions/download-artifact@v4 + with: + name: nargo + path: ./nargo + + - name: Set nargo on PATH + shell: bash + run: | + nargo_binary="./nargo/nargo" + chmod +x $nargo_binary + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 4e836ef2493..34216c22e01 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -123,18 +123,7 @@ jobs: uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Format stdlib working-directory: ./noir_stdlib diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 2a1dbc078ac..438c74b7840 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -54,18 +54,7 @@ jobs: echo "$HOME/.bb/" >> $GITHUB_PATH - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Generate gates report working-directory: ./test_programs @@ -100,18 +89,7 @@ jobs: - uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Generate Brillig bytecode size report working-directory: ./test_programs @@ -160,18 +138,7 @@ jobs: - uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Generate Brillig execution report working-directory: ./test_programs @@ -220,18 +187,7 @@ jobs: - uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Generate Memory report working-directory: ./test_programs @@ -272,18 +228,7 @@ jobs: - uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Generate Compilation report working-directory: ./test_programs @@ -335,20 +280,10 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root, num_runs: 5 } name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }} - steps: - - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + + s: + - name: Download nargo binary + uses: ./.github/actions/download-nargo - uses: actions/checkout@v4 with: @@ -450,20 +385,10 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root } name: External repo memory report - ${{ matrix.project.repo }}/${{ matrix.project.path }} - steps: - - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + + s: + - name: Download nargo binary + uses: ./.github/actions/download-nargo - uses: actions/checkout@v4 with: diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index 498d5160e27..e3060b5ecec 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -244,10 +244,7 @@ jobs: uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo + uses: ./.github/actions/download-nargo - name: Download artifact uses: actions/download-artifact@v4 @@ -261,14 +258,6 @@ jobs: name: noirc_abi_wasm path: ./tooling/noirc_abi_wasm - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V - - name: Install Yarn dependencies uses: ./.github/actions/setup @@ -300,17 +289,7 @@ jobs: uses: ./.github/actions/setup - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" + uses: ./.github/actions/download-nargo - name: Build fixtures run: yarn workspace @noir-lang/noir_wasm test:build_fixtures @@ -335,10 +314,7 @@ jobs: uses: actions/checkout@v4 - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo + uses: ./.github/actions/download-nargo - name: Download acvm_js package artifact uses: actions/download-artifact@v4 @@ -352,14 +328,6 @@ jobs: name: noirc_abi_wasm path: ./tooling/noirc_abi_wasm - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V - - name: Install Yarn dependencies uses: ./.github/actions/setup @@ -388,10 +356,7 @@ jobs: echo "$HOME/.bb/" >> $GITHUB_PATH - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo + uses: ./.github/actions/download-nargo - name: Download acvm_js package artifact uses: actions/download-artifact@v4 @@ -411,14 +376,6 @@ jobs: name: noirc_abi_wasm path: ./tooling/noirc_abi_wasm - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V - - name: Install Yarn dependencies uses: ./.github/actions/setup @@ -493,25 +450,13 @@ jobs: with: version: nightly-8660e5b941fe7f4d67e246cfd3dafea330fb53b1 - - name: Install `bb` run: | ./scripts/install_bb.sh echo "$HOME/.bb/" >> $GITHUB_PATH - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Run `prove_and_verify` working-directory: ./examples/prove_and_verify @@ -564,18 +509,7 @@ jobs: ref: ${{ matrix.project.ref }} - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Remove requirements on compiler version working-directory: ./test-repo @@ -588,7 +522,6 @@ jobs: id: test_report working-directory: ./test-repo/${{ matrix.project.path }} run: | - output_file=${{ github.workspace }}/noir-repo/.github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.actual.jsonl BEFORE=$SECONDS nargo test --silence-warnings --skip-brillig-constraints-check --format json ${{ matrix.project.nargo_args }} | tee $output_file @@ -641,18 +574,7 @@ jobs: path: test-repo - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + uses: ./.github/actions/download-nargo - name: Remove requirements on compiler version working-directory: ./test-repo From f62e937b5c19f58032d7a96cd891dfd35edd2696 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 5 Feb 2025 00:14:21 +0000 Subject: [PATCH 2/5] . --- .github/actions/download-nargo/action.yml | 2 +- .github/workflows/reports.yml | 5 ++--- .github/workflows/test-js-packages.yml | 9 +++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/actions/download-nargo/action.yml b/.github/actions/download-nargo/action.yml index 01d4aa38db0..49c8b1d0bd8 100644 --- a/.github/actions/download-nargo/action.yml +++ b/.github/actions/download-nargo/action.yml @@ -13,6 +13,6 @@ runs: - name: Set nargo on PATH shell: bash run: | - nargo_binary="./nargo/nargo" + nargo_binary="${{ github.workspace }}/nargo/nargo" chmod +x $nargo_binary echo "$(dirname $nargo_binary)" >> $GITHUB_PATH diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 438c74b7840..4f5ae5ad3bd 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -280,9 +280,8 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root, num_runs: 5 } name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }} - - s: - - name: Download nargo binary + steps: + - name: Download nargo binary uses: ./.github/actions/download-nargo - uses: actions/checkout@v4 diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index e3060b5ecec..1ebd6052632 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -509,7 +509,7 @@ jobs: ref: ${{ matrix.project.ref }} - name: Download nargo binary - uses: ./.github/actions/download-nargo + uses: ./noir-repo/.github/actions/download-nargo - name: Remove requirements on compiler version working-directory: ./test-repo @@ -567,6 +567,11 @@ jobs: timeout-minutes: 30 name: Compile `noir-contracts` zero inliner aggressiveness steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: noir-repo + - name: Checkout uses: actions/checkout@v4 with: @@ -574,7 +579,7 @@ jobs: path: test-repo - name: Download nargo binary - uses: ./.github/actions/download-nargo + uses: ./noir-repo/.github/actions/download-nargo - name: Remove requirements on compiler version working-directory: ./test-repo From 4a8e1cc25dafb7c798193977ac43e3523dead282 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 5 Feb 2025 00:28:13 +0000 Subject: [PATCH 3/5] . --- .github/workflows/reports.yml | 10 +++---- .github/workflows/test-js-packages.yml | 38 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 4f5ae5ad3bd..750a50719ad 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -384,18 +384,18 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root } name: External repo memory report - ${{ matrix.project.repo }}/${{ matrix.project.path }} - - s: - - name: Download nargo binary - uses: ./.github/actions/download-nargo - + steps: - uses: actions/checkout@v4 with: path: scripts sparse-checkout: | + ./.github/actions/download-nargo test_programs/memory_report.sh test_programs/parse_memory.sh sparse-checkout-cone-mode: false + + - name: Download nargo binary + uses: ./.github/actions/download-nargo - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index 1ebd6052632..b92b2ae2030 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -13,6 +13,25 @@ concurrency: cancel-in-progress: true jobs: + critical-library-list: + name: Load critical library list + runs-on: ubuntu-22.04 + outputs: + libraries: ${{ steps.get_critical_libraries.outputs.libraries }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build list of libraries + id: get_critical_libraries + run: | + LIBRARIES=$(yq ./EXTERNAL_NOIR_LIBRARIES.yml -o json | jq -c '.libraries | map({ repo, path: (.path // ""), timeout:(.timeout // 2), nargo_args })') + echo "libraries=$LIBRARIES" + echo "libraries=$LIBRARIES" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + yarn-lock: runs-on: ubuntu-22.04 timeout-minutes: 30 @@ -466,25 +485,6 @@ jobs: working-directory: ./examples/codegen_verifier run: ./test.sh - critical-library-list: - name: Load critical library list - runs-on: ubuntu-22.04 - outputs: - libraries: ${{ steps.get_critical_libraries.outputs.libraries }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build list of libraries - id: get_critical_libraries - run: | - LIBRARIES=$(yq ./EXTERNAL_NOIR_LIBRARIES.yml -o json | jq -c '.libraries | map({ repo, path: (.path // ""), timeout:(.timeout // 2), nargo_args })') - echo "libraries=$LIBRARIES" - echo "libraries=$LIBRARIES" >> $GITHUB_OUTPUT - env: - GH_TOKEN: ${{ github.token }} - external-repo-checks: needs: [build-nargo, critical-library-list] runs-on: ubuntu-22.04 From f51a7ff74d94fd979c83d56ce0c18fce3dd76e4a Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 5 Feb 2025 00:50:13 +0000 Subject: [PATCH 4/5] . --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 750a50719ad..7937db62020 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -395,7 +395,7 @@ jobs: sparse-checkout-cone-mode: false - name: Download nargo binary - uses: ./.github/actions/download-nargo + uses: ./scripts/.github/actions/download-nargo - name: Checkout uses: actions/checkout@v4 From a64367fbed4e8afcb7ce7a63f7d7ffeed0acae1b Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 5 Feb 2025 01:17:11 +0000 Subject: [PATCH 5/5] . --- .github/workflows/reports.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 7937db62020..1ac775591a6 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -281,18 +281,19 @@ jobs: name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }} steps: - - name: Download nargo binary - uses: ./.github/actions/download-nargo - - uses: actions/checkout@v4 with: path: scripts sparse-checkout: | + .github/actions/download-nargo/action.yml test_programs/compilation_report.sh test_programs/execution_report.sh test_programs/parse_time.sh sparse-checkout-cone-mode: false + - name: Download nargo binary + uses: scripts/.github/actions/download-nargo + - name: Checkout uses: actions/checkout@v4 with: @@ -389,7 +390,7 @@ jobs: with: path: scripts sparse-checkout: | - ./.github/actions/download-nargo + ./.github/actions/download-nargo/action.yml test_programs/memory_report.sh test_programs/parse_memory.sh sparse-checkout-cone-mode: false