Skip to content

Commit

Permalink
feat: move noir-tests to earthly (#6185)
Browse files Browse the repository at this point in the history
Move noir-tests to earthly and github actions
  • Loading branch information
alexghr authored May 5, 2024
1 parent 58e40c9 commit 4daea40
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 54 deletions.
13 changes: 0 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -504,7 +492,6 @@ workflows:
- noir-x86_64
- noir-arm64
<<: *defaults
- noir-tests: *defaults
- noir-packages:
requires:
- bb-js
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -409,6 +424,7 @@ jobs:
- yarn-project-test
- prover-client-test
- noir-packages-test
- noir-test
if: always()
steps:
- run: |
Expand Down
49 changes: 8 additions & 41 deletions noir/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4daea40

Please sign in to comment.