-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into jf/fix-2045
- Loading branch information
Showing
816 changed files
with
5,756 additions
and
894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,90 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build Wasm | ||
# TODO: Replace this step with downloading a wasm binary from a set release of Barretenberg | ||
build-barretenberg: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Noir repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Collect locked barretenberg rev | ||
run: | | ||
echo "BB_REV=$(jq -r .nodes.barretenberg.locked.rev ./flake.lock)" >> $GITHUB_ENV | ||
echo "BB_REV is ${{ env.BB_REV }}" | ||
- uses: cachix/install-nix-action@v20 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-22.11 | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: barretenberg | ||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
|
||
# Upload does not work with symlinks, using this workaround: | ||
# https://github.com/actions/upload-artifact/issues/92#issuecomment-1080347032 | ||
- name: Build barretenberg as libbarretenberg-wasm32 | ||
run: | | ||
echo "BB_REV is ${{ env.BB_REV }}" | ||
nix build "github:AztecProtocol/barretenberg/${{ env.BB_REV }}#wasm32" | ||
echo "ARTIFACT_UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: libbarretenberg-wasm32 | ||
path: ${{ env.ARTIFACT_UPLOAD_PATH }} | ||
retention-days: 3 | ||
|
||
build-nargo: | ||
needs: [build-barretenberg] | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout Noir repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: libbarretenberg-wasm32 | ||
path: ${{ github.workspace }}/libbarretenberg-wasm32 | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
|
||
- name: Build Nargo | ||
env: | ||
BARRETENBERG_BIN_DIR: ${{ github.workspace }}/libbarretenberg-wasm32/bin | ||
run: | | ||
cargo build --package nargo_cli --release --no-default-features --features plonk_bn254_wasm | ||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
cp ./target/release/nargo ./dist/nargo | ||
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nargo | ||
path: ./dist/* | ||
retention-days: 3 | ||
|
||
build-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
|
@@ -25,3 +107,54 @@ jobs: | |
- name: Build wasm package | ||
run: | | ||
nix build -L .#wasm | ||
- name: Dereference symlink | ||
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: noir_wasm | ||
path: ${{ env.UPLOAD_PATH }} | ||
retention-days: 3 | ||
|
||
test: | ||
needs: [build-wasm, build-nargo] | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout noir-lang/noir | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download wasm package artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: noir_wasm | ||
path: ./crates/wasm/dist | ||
|
||
- name: Download nargo binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: nargo | ||
path: ./nargo | ||
|
||
- name: Compile test program with Nargo CLI | ||
working-directory: ./crates/wasm/noir-script | ||
run: | | ||
nargo_binary=${{ github.workspace }}/nargo/nargo | ||
chmod +x $nargo_binary | ||
$nargo_binary compile | ||
- name: Install dependencies | ||
working-directory: ./crates/wasm | ||
run: yarn install | ||
|
||
- name: Install playwright deps | ||
working-directory: ./crates/wasm | ||
run: | | ||
npx playwright install | ||
npx playwright install-deps | ||
- name: Run tests | ||
working-directory: ./crates/wasm | ||
run: yarn test:browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ wasm-bindgen.workspace = true | |
|
||
[dev-dependencies] | ||
tempfile = "3.2.0" | ||
iter-extended.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.