Skip to content

Commit

Permalink
Merge branch 'master' into tf/borrowed-acir
Browse files Browse the repository at this point in the history
* master: (31 commits)
  chore: run tests for `noir_wasm` in node under default resolver (#3020)
  chore: align versions for js packages (#3019)
  fix: Fix aztec library after nargo fmt (#3014)
  chore: simplify ES workspace build and publish (#2989)
  fix: fix method `program_counter`, change method signature (#3012)
  fix: ACIR optimizer should update assertion messages (#3010)
  fix: check for overflow with hexadecimal inputs (#3004)
  feat(traits): Add trait impl for buildin types (#2964)
  feat(traits): added checks for duplicated trait associated items (types, consts, functions) (#2927)
  chore(formatter): trim spaces after opening brace (#3005)
  feat: format infix expressions (#3001)
  feat: provide formatting subcommand  (#2640)
  chore: Noir.js interface accepts a stuct of public inputs and proof (#2992)
  fix: Transform hir before type checks  (#2994)
  fix!: Make for loops a statement (#2975)
  feat: Add aztec selectors for event structs (#2983)
  fix(traits)!: trait functions with a default implementation must not be followed by a semicolon (#2987)
  chore: strip initialization of unused memory blocks from ACIR (#2985)
  chore: clippy fix (#2986)
  chore(ci): replace webdriver with playwright (#2988)
  ...
  • Loading branch information
TomAFrench committed Oct 6, 2023
2 parents 56af2dc + 9893dc7 commit f842593
Show file tree
Hide file tree
Showing 310 changed files with 4,075 additions and 2,964 deletions.
27 changes: 27 additions & 0 deletions .github/actions/nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup Nix
description: Installs and setups Nix components

inputs:
github-token:
description: 'Github Access Token'
required: true
nix-cache-name:
description: 'Name of the Cachix cache to use'
required: true
cachix-auth-token:
description: 'Cachix Auth Token'
required: true


runs:
using: composite
steps:
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
github_access_token: ${{ inputs.github-token }}

- uses: cachix/cachix-action@v12
with:
name: ${{ inputs.nix-cache-name }}
authToken: ${{ inputs.cachix-auth-token }}
89 changes: 89 additions & 0 deletions .github/workflows/auto-pr-rebuild-script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Rebuild ACIR artifacts

on:
push:
branches:
- master

jobs:
build-nargo:
runs-on: ubuntu-22.04
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]

steps:
- name: Checkout Noir repo
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/[email protected]

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}

- name: Build Nargo
run: cargo build --package nargo_cli --release

- 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

auto-pr-rebuild-script:
needs: [build-nargo]
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Download nargo binary
uses: actions/download-artifact@v3
with:
name: nargo
path: ./nargo

- name: Add Nargo to $PATH
run: |
chmod +x ${{ github.workspace }}/nargo/nargo
echo "${{ github.workspace }}/nargo" >> $GITHUB_PATH
- name: Set up Git user (Github Action)
run: |
git config --local user.name kevaundray
git config --local user.email [email protected]
- name: Run rebuild script
working-directory: tooling/nargo_cli/tests
run: |
chmod +x ./rebuild.sh
./rebuild.sh
- name: Check for changes in acir_artifacts directory
id: check_changes
run: |
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true"
- name: Create or Update PR
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.NOIR_REPO_TOKEN }}
commit-message: "chore: update acir artifacts"
title: "chore: Update ACIR artifacts"
body: "Automatic PR to update acir artifacts"
add-paths: tooling/nargo_cli/tests/acir_artifacts/*.gz
labels: "auto-pr"
branch: "auto-pr-rebuild-script-branch"
82 changes: 82 additions & 0 deletions .github/workflows/publish-es-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish Noir ES Packages

on:
workflow_dispatch:

jobs:
build-noir_wasm:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Build wasm package
run: |
nix build -L .#noir_wasm
build-noirc_abi_wasm:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Build wasm package
run: |
nix build -L .#noirc_abi_wasm
build-acvm_js:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Build wasm package
run: |
nix build -L .#acvm_js
publish-es-packages:
runs-on: ubuntu-latest
needs: [build-acvm_js, build-noirc_abi_wasm, build-noir_wasm]
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Nix
uses: ./.github/actions/nix
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Install Yarn dependencies
run: yarn install

- name: Build ES Packages
run: yarn prepare:publish

- name: Authenticate with npm
run: "echo npmAuthToken: ${{ secrets.NPM_TOKEN }} > ~/.yarnrc.yml"

- name: Publish ES Packages
run: yarn publish:all --access public
72 changes: 3 additions & 69 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,81 +65,15 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'

publish-wasm:
name: Publish noir_wasm package
publish-es-packages:
name: Publish ES packages
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to noir_wasm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-noir-wasm.yml
workflow: publish-es-packages.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

publish-noir-js:
name: Publish noir_js package
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to noir_wasm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-noir-js.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

publish-source-resolver:
name: Publish source resolver package
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to source resolver
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-source-resolver.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

publish-abi-wasm:
name: Dispatch to publish-abi_wasm workflow
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Trigger publish-abi_wasm.yml workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-abi_wasm.yml
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }'

publish-acvm:
name: Publish crates
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-acvm.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'

publish-acvm-js:
name: Dispatch to publish-acvm-js workflow
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Trigger publish-acvm-js.yml workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-acvm-js.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'
3 changes: 3 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ jobs:
- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Install Playwright
uses: ./.github/actions/install-playwright

- name: Install jq
run: sudo apt-get install jq

Expand Down
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"tooling/bb_abstraction_leaks",
"tooling/lsp",
"tooling/nargo",
"tooling/nargo_fmt",
"tooling/nargo_cli",
"tooling/nargo_toml",
"tooling/noirc_abi",
Expand Down Expand Up @@ -49,6 +50,7 @@ arena = { path = "compiler/utils/arena" }
fm = { path = "compiler/fm" }
iter-extended = { path = "compiler/utils/iter-extended" }
nargo = { path = "tooling/nargo" }
nargo_fmt = { path = "tooling/nargo_fmt" }
nargo_cli = { path = "tooling/nargo_cli" }
nargo_toml = { path = "tooling/nargo_toml" }
noir_lsp = { path = "tooling/lsp" }
Expand Down Expand Up @@ -80,6 +82,7 @@ tower = "0.4"
url = "2.2.0"
wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.33"
js-sys = "0.3.62"
base64 = "0.21.2"
fxhash = "0.2.1"
acir = { path = "acvm-repo/acir", default-features = false }
Expand Down
Loading

0 comments on commit f842593

Please sign in to comment.