Skip to content

Commit

Permalink
Merge branch 'master' into refactor-constant-folding
Browse files Browse the repository at this point in the history
* master:
  chore: Replace hashers of hashmaps in dfg with fxhashes (#2490)
  chore: remove duplicate span from FunctionReturnType (#2546)
  feat: Add support for brillig call stacks in runtime errors (#2549)
  feat: add `noirc_abi_wasm` crate for ABI encoding in JS (#1945)
  chore: move CRS files into their own directory (#2558)
  chore: Cleanup `rebuild.sh` script (#2470)
  chore(ci): add mocked backend binary to improve `compile_success_empty` tests (#2554)
  chore: add noir-source-resolver (#2485)
  chore: fix double verify proof (#2556)
  feat: add `nargo backend ls` and `nargo backend use` command to switch between backends (#2552)
  chore(ci): bump checkout action to v4 (#2551)
  feat: Support for optional assertion messages (#2491)
  fix: allow usage of decimal string encoding for fields larger than a `i128` (#2547)
  feat(nargo): add hidden option to produce JSON output from `nargo info` (#2542)
  chore(stdlib)!: Rename `fixed_base_scalar_mul` to be more descriptive (#2488)
  chore: Document requirement for range opcode on `r_witness` in  `GeneratedAcir::euclidean_division` (#2437)
  chore!: ACVM 0.24 (#2504)
  fix(aztec_noir): generalise loop to not always inject a hasher instance (#2529)
  chore: create helper functions for writing programs and contracts to file (#2526)
  • Loading branch information
TomAFrench committed Sep 5, 2023
2 parents 2ba69e8 + 255febd commit 229c5b9
Show file tree
Hide file tree
Showing 491 changed files with 11,659 additions and 582 deletions.
26 changes: 26 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Setup

inputs:
working-directory:
default: ./
required: false

runs:
using: composite
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.15
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: "**/node_modules"
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install
run: |
cd ${{ inputs.working-directory }}
yarn --immutable
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
122 changes: 122 additions & 0 deletions .github/workflows/abi_wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: ABI Wasm test

on:
pull_request:
merge_group:

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
noirc-abi-wasm-build:
runs-on: ubuntu-latest
env:
CACHED_PATH: /tmp/nix-cache

steps:
- name: Checkout sources
uses: actions/checkout@v3

- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-23.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore nix store cache
uses: actions/cache/restore@v3
id: cache
with:
path: ${{ env.CACHED_PATH }}
key: ${{ runner.os }}-flake-abi-wasm-${{ hashFiles('*.lock') }}

# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
- name: Copy cache into nix store
if: steps.cache.outputs.cache-hit == 'true'
# We don't check the signature because we're the one that created the cache
run: |
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
path=$(head -n 1 "$narinfo" | awk '{print $2}')
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
done
- name: Build noirc_abi_wasm
run: |
nix build -L .#noirc_abi_wasm
- name: Export cache from nix store
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
run: |
nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd&parallel-compression=true" .#noirc-abi-wasm-cargo-artifacts
- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATH }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Dereference symlink
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: noirc_abi_wasm
path: ${{ env.UPLOAD_PATH }}
retention-days: 10

noirc-abi-wasm-test-node:
needs: [noirc-abi-wasm-build]
name: Node.js Tests
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: noirc_abi_wasm
path: ./result

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./crates/noirc_abi_wasm

- name: Run node tests
working-directory: ./crates/noirc_abi_wasm
run: yarn test

noirc-abi-wasm-test-browser:
needs: [noirc-abi-wasm-build]
name: Browser Tests
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: noirc_abi_wasm
path: ./result

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./crates/noirc_abi_wasm

- name: Install playwright deps
working-directory: ./crates/noirc_abi_wasm
run: |
npx playwright install
npx playwright install-deps
- name: Run browser tests
working-directory: ./crates/noirc_abi_wasm
run: yarn test:browser
12 changes: 4 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || env.GITHUB_REF }}

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
with:
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Package artifacts
run: |
mkdir dist
Expand Down Expand Up @@ -120,15 +120,11 @@ jobs:
strategy:
fail-fast: false
matrix:
target:
[
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl,
]
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || env.GITHUB_REF }}

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release-source-resolver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release and Publish Source Resolver

on:
workflow_dispatch:
inputs:
version:
description: "Version number"
required: false

jobs:
release-source-resolver:
name: Release and Publish Source Resolver
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Bump version
working-directory: ./crates/source-resolver
id: bump_version
run: |
if [ -z "${{ github.event.inputs.version }}" ]; then
NEW_VERSION=$(npm version patch --no-git-tag-version)
else
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
fi
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Install dependencies
working-directory: ./crates/source-resolver
run: npm install

- name: Build noir-source-resolver
working-directory: ./crates/source-resolver
run: npm run build

- name: Publish to NPM
working-directory: ./crates/source-resolver
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Configure git
run: |
git config user.name kevaundray
git config user.email [email protected]
- name: Commit updates
run: |
git add crates/source-resolver/package-lock.json
git add crates/source-resolver/package.json
git commit -m "chore: Update source-resolver to ${{ env.NEW_VERSION }}"
git push
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout release branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/test-source-resolver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Source Resolver

on:
push:
paths:
- "crates/source-resolver/**"
pull_request:
paths:
- "crates/source-resolver/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
working-directory: ./crates/source-resolver
run: npm install

- name: Build noir-source-resolver
working-directory: ./crates/source-resolver
run: npm run build

- name: Run tests
working-directory: ./crates/source-resolver
run: npm run test
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Restore nix store cache
uses: actions/cache/restore@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout Noir repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/cache/restore@v3
id: cache
Expand All @@ -39,7 +39,7 @@ jobs:
# Don't create cache entries for the merge queue.
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATHS }}
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Package artifacts
Expand All @@ -62,7 +62,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Nix
uses: cachix/install-nix-action@v22
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout noir-lang/noir
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download wasm package artifact
uses: actions/download-artifact@v3
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ examples/9
node_modules
pkg/

# Source resolver
crates/source-resolver/node_modules
crates/source-resolver/lib
crates/source-resolver/lib-node

# Nix stuff
**/outputs
result
Expand All @@ -20,8 +25,8 @@ result
*.vk
**/Verifier.toml
**/target
!crates/nargo_cli/tests/execution_success/*/target
!crates/nargo_cli/tests/execution_success/*/target/witness.tr
!crates/nargo_cli/tests/acir_artifacts/*/target
!crates/nargo_cli/tests/acir_artifacts/*/target/witness.gz

# Github Actions scratch space
# This gives a location to download artifacts into the repository in CI without making git dirty.
Expand Down
Loading

0 comments on commit 229c5b9

Please sign in to comment.