diff --git a/build_manifest.yml b/build_manifest.yml index 0824765b52b6..b26e4e84d968 100644 --- a/build_manifest.yml +++ b/build_manifest.yml @@ -71,6 +71,15 @@ noir-projects: - noir - avm-transpiler +# Compiles all aztec noir projects using nargo and the avm-transpiler, then tests them using the TXE. +noir-projects-tests: + buildDir: noir-projects + dockerfile: Dockerfile.test + dependencies: + - noir + - avm-transpiler + - yarn-project + # Uses nargo to compile all the noir test programs, used to test bb and bb.js. noir-compile-acir-tests: buildDir: noir/noir-repo/test_programs diff --git a/noir-projects/Dockerfile b/noir-projects/Dockerfile index b8abf566f844..dc2ecf463622 100644 --- a/noir-projects/Dockerfile +++ b/noir-projects/Dockerfile @@ -1,6 +1,5 @@ FROM aztecprotocol/noir as noir FROM aztecprotocol/avm-transpiler as transpiler -FROM aztecprotocol/yarn-project AS yarn-project FROM ubuntu:lunar AS builder RUN apt-get update && apt-get install -y parallel nodejs npm @@ -14,25 +13,13 @@ ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}" # Copy in noir projects WORKDIR /usr/src/noir-projects COPY . . - - # Build -WORKDIR /usr/src/noir-projects -RUN cd noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings - -RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ - # Wait for TXE to initialize - sleep 5 && \ - cd /usr/src/noir-projects/noir-contracts && \ - ./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ - kill $(cat /tmp/txe.pid) - -RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ - # Wait for TXE to initialize - sleep 5 && \ - cd /usr/src/noir-projects/aztec-nr && \ - nargo test --silence-warnings --oracle-resolver http://localhost:8080 - +WORKDIR /usr/src/noir-projects/noir-contracts +RUN ./bootstrap.sh +WORKDIR /usr/src/noir-projects/noir-protocol-circuits +RUN ./bootstrap.sh +WORKDIR /usr/src/noir-projects/aztec-nr +RUN nargo compile --silence-warnings FROM scratch COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects \ No newline at end of file diff --git a/noir-projects/Dockerfile.test b/noir-projects/Dockerfile.test new file mode 100644 index 000000000000..40edcbaaf35e --- /dev/null +++ b/noir-projects/Dockerfile.test @@ -0,0 +1,38 @@ +FROM aztecprotocol/noir as noir +FROM aztecprotocol/avm-transpiler as transpiler +FROM aztecprotocol/yarn-project as yarn-project + +RUN apt-get update && apt-get install -y parallel + +# Copy in nargo +COPY --from=noir /usr/src/noir/noir-repo/target/release/nargo /usr/src/noir/noir-repo/target/release/nargo +ENV PATH="/usr/src/noir/noir-repo/target/release:${PATH}" +# Copy in transpiler +COPY --from=transpiler /usr/src/avm-transpiler/target/release/avm-transpiler /usr/src/avm-transpiler/target/release/avm-transpiler +ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}" + +# All built files are ignored so we have to repeat the txe build here. +# It is fast (compared to the tests) and we're moving to earthly, so we don't bother with something more sophisticated. +WORKDIR /usr/src/yarn-project +RUN yarn workspaces focus @aztec/txe +RUN cd ./txe && yarn build + +# Copy in noir projects +WORKDIR /usr/src/noir-projects +COPY . . + +# Build & test +RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd ./noir-contracts && \ + ./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ + kill $(cat /tmp/txe.pid) + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd ./aztec-nr && \ + nargo test --silence-warnings --oracle-resolver http://localhost:8080 \ No newline at end of file