From 4daea40fc8d994f25321ee6359ad37321ccd99dd Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Sun, 5 May 2024 22:41:03 +0300 Subject: [PATCH] feat: move noir-tests to earthly (#6185) Move noir-tests to earthly and github actions --- .circleci/config.yml | 13 ----------- .github/workflows/ci.yml | 16 +++++++++++++ noir/Earthfile | 49 +++++++--------------------------------- 3 files changed, 24 insertions(+), 54 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73655966bf3..28b9d04f19d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -230,18 +230,6 @@ jobs: command: create_ecr_manifest noir x86_64,arm64 aztec_manifest_key: noir - noir-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build noir-tests 32 - aztec_manifest_key: noir-tests - noir-packages: docker: - image: aztecprotocol/alpine-build-image @@ -504,7 +492,6 @@ workflows: - noir-x86_64 - noir-arm64 <<: *defaults - - noir-tests: *defaults - noir-packages: requires: - bb-js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63ba605aca4..2f01324165f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,6 +145,21 @@ jobs: timeout-minutes: 25 run: earthly-ci --no-output ./+test + noir-test: + needs: setup + runs-on: ${{ inputs.username || github.actor }}-x86 + steps: + - { + uses: actions/checkout@v4, + with: { ref: "${{ github.event.pull_request.head.sha }}" }, + } + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" + concurrency_key: noir-${{ inputs.username || github.actor }}-x86 + - name: "Test Noir JS packages" + run: earthly-ci --no-output ./noir+test + noir-packages-test: needs: setup runs-on: ${{ inputs.username || github.actor }}-x86 @@ -409,6 +424,7 @@ jobs: - yarn-project-test - prover-client-test - noir-packages-test + - noir-test if: always() steps: - run: | diff --git a/noir/Earthfile b/noir/Earthfile index 82b19984d49..3fb400700b5 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -38,6 +38,12 @@ nargo: SAVE ARTIFACT /usr/src/noir-repo/target/release/acvm acvm SAVE IMAGE aztecprotocol/nargo +test: + FROM +nargo + COPY ./scripts/test_native.sh ./scripts/test_native.sh + COPY noir-repo/.rustfmt.toml noir-repo/.rustfmt.toml + RUN ./scripts/test_native.sh + packages-deps: BUILD ../barretenberg/ts/+build # prefetch @@ -269,45 +275,6 @@ barretenberg-acir-tests-bb.js: # See https://github.com/AztecProtocol/aztec-packages/issues/2104 #RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul - -# TOOD -# test-packages -# FROM aztecprotocol/noir AS noir - -# FROM node:20 AS builder -# COPY --from=noir /usr/src/noir/noir-repo/target/release /usr/src/noir/noir-repo/target/release -# ENV PATH=${PATH}:/usr/src/noir/noir-repo/target/release -# RUN curl https://sh.rustup.rs -sSf | bash -s -- -y -# RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc -# ENV PATH=/root/.cargo/bin:${PATH} -# RUN apt update && apt install -y jq libc++1 -# ARG COMMIT_HASH -# ENV COMMIT_HASH=${COMMIT_HASH} - -# WORKDIR /usr/src/noir -# COPY . . -# RUN ./scripts/test_js_packages.sh - -# # Don't waste time pushing a huge container back to ECR as nothing needs the output. -# FROM scratch -# COPY --from=builder /usr/src/noir/README.md /usr/src/noir/README.md - -# TODO -# test: -# FROM rust:bullseye -# ARG COMMIT_HASH -# ENV COMMIT_HASH=${COMMIT_HASH} -# RUN apt update && apt install -y libc++1 -# WORKDIR /usr/src/noir -# COPY . . -# RUN ./scripts/test_native.sh - -# # Don't waste time pushing a huge container back to ECR as nothing needs the output. -# FROM scratch -# COPY --from=0 /usr/src/noir/README.md /usr/src/noir/README.md - - - #* Analysis of compiling Acir tests inside/outside Earthly # Each test run compiles the full suite, either in series or in parallel, either inside or outside Earthly. # Each test prints the contents of the target directory of the eddsa circuit after compilation @@ -337,9 +304,9 @@ barretenberg-acir-tests-bb.js: # +build-acir-tests | total 2472 # +build-acir-tests | -rw-r--r-- 1 root root 830340 May 3 10:47 acir.gz # +build-acir-tests | -rw-r--r-- 1 root root 1696442 May 3 10:47 witness.gz - + # Inside Earthly Series - + # +build-acir-tests | [eddsa] Circuit witness successfully solved # +build-acir-tests | [eddsa] Witness saved to /usr/src/noir-repo/test_programs/execution_success/eddsa/target/witness.gz # +build-acir-tests | total 2544