Skip to content

Commit f842593

Browse files
committed
Merge branch 'master' into tf/borrowed-acir
* 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) ...
2 parents 56af2dc + 9893dc7 commit f842593

310 files changed

Lines changed: 4075 additions & 2964 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/nix/action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Setup Nix
2+
description: Installs and setups Nix components
3+
4+
inputs:
5+
github-token:
6+
description: 'Github Access Token'
7+
required: true
8+
nix-cache-name:
9+
description: 'Name of the Cachix cache to use'
10+
required: true
11+
cachix-auth-token:
12+
description: 'Cachix Auth Token'
13+
required: true
14+
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- uses: cachix/install-nix-action@v22
20+
with:
21+
nix_path: nixpkgs=channel:nixos-23.05
22+
github_access_token: ${{ inputs.github-token }}
23+
24+
- uses: cachix/cachix-action@v12
25+
with:
26+
name: ${{ inputs.nix-cache-name }}
27+
authToken: ${{ inputs.cachix-auth-token }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Rebuild ACIR artifacts
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-nargo:
10+
runs-on: ubuntu-22.04
11+
strategy:
12+
matrix:
13+
target: [x86_64-unknown-linux-gnu]
14+
15+
steps:
16+
- name: Checkout Noir repo
17+
uses: actions/checkout@v4
18+
19+
- name: Setup toolchain
20+
uses: dtolnay/rust-toolchain@1.66.0
21+
22+
- uses: Swatinem/rust-cache@v2
23+
with:
24+
key: ${{ matrix.target }}
25+
cache-on-failure: true
26+
save-if: ${{ github.event_name != 'merge_group' }}
27+
28+
- name: Build Nargo
29+
run: cargo build --package nargo_cli --release
30+
31+
- name: Package artifacts
32+
run: |
33+
mkdir dist
34+
cp ./target/release/nargo ./dist/nargo
35+
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz
36+
37+
- name: Upload artifact
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: nargo
41+
path: ./dist/*
42+
retention-days: 3
43+
44+
auto-pr-rebuild-script:
45+
needs: [build-nargo]
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Check out code
50+
uses: actions/checkout@v2
51+
52+
- name: Download nargo binary
53+
uses: actions/download-artifact@v3
54+
with:
55+
name: nargo
56+
path: ./nargo
57+
58+
- name: Add Nargo to $PATH
59+
run: |
60+
chmod +x ${{ github.workspace }}/nargo/nargo
61+
echo "${{ github.workspace }}/nargo" >> $GITHUB_PATH
62+
63+
- name: Set up Git user (Github Action)
64+
run: |
65+
git config --local user.name kevaundray
66+
git config --local user.email kevtheappdev@gmail.com
67+
68+
- name: Run rebuild script
69+
working-directory: tooling/nargo_cli/tests
70+
run: |
71+
chmod +x ./rebuild.sh
72+
./rebuild.sh
73+
74+
- name: Check for changes in acir_artifacts directory
75+
id: check_changes
76+
run: |
77+
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true"
78+
79+
- name: Create or Update PR
80+
if: steps.check_changes.outputs.changes == 'true'
81+
uses: peter-evans/create-pull-request@v3
82+
with:
83+
token: ${{ secrets.NOIR_REPO_TOKEN }}
84+
commit-message: "chore: update acir artifacts"
85+
title: "chore: Update ACIR artifacts"
86+
body: "Automatic PR to update acir artifacts"
87+
add-paths: tooling/nargo_cli/tests/acir_artifacts/*.gz
88+
labels: "auto-pr"
89+
branch: "auto-pr-rebuild-script-branch"
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Publish Noir ES Packages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-noir_wasm:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout sources
11+
uses: actions/checkout@v4
12+
13+
- name: Setup Nix
14+
uses: ./.github/actions/nix
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
18+
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}
19+
20+
- name: Build wasm package
21+
run: |
22+
nix build -L .#noir_wasm
23+
24+
build-noirc_abi_wasm:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout sources
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Nix
31+
uses: ./.github/actions/nix
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
35+
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}
36+
37+
- name: Build wasm package
38+
run: |
39+
nix build -L .#noirc_abi_wasm
40+
41+
build-acvm_js:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout sources
45+
uses: actions/checkout@v4
46+
47+
- name: Setup Nix
48+
uses: ./.github/actions/nix
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
52+
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}
53+
54+
- name: Build wasm package
55+
run: |
56+
nix build -L .#acvm_js
57+
58+
publish-es-packages:
59+
runs-on: ubuntu-latest
60+
needs: [build-acvm_js, build-noirc_abi_wasm, build-noir_wasm]
61+
steps:
62+
- name: Checkout sources
63+
uses: actions/checkout@v4
64+
65+
- name: Setup Nix
66+
uses: ./.github/actions/nix
67+
with:
68+
github-token: ${{ secrets.GITHUB_TOKEN }}
69+
nix-cache-name: ${{ vars.NIX_CACHE_NAME }}
70+
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}
71+
72+
- name: Install Yarn dependencies
73+
run: yarn install
74+
75+
- name: Build ES Packages
76+
run: yarn prepare:publish
77+
78+
- name: Authenticate with npm
79+
run: "echo npmAuthToken: ${{ secrets.NPM_TOKEN }} > ~/.yarnrc.yml"
80+
81+
- name: Publish ES Packages
82+
run: yarn publish:all --access public

.github/workflows/release.yml

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -65,81 +65,15 @@ jobs:
6565
token: ${{ secrets.GITHUB_TOKEN }}
6666
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'
6767

68-
publish-wasm:
69-
name: Publish noir_wasm package
68+
publish-es-packages:
69+
name: Publish ES packages
7070
needs: [release-please]
7171
if: ${{ needs.release-please.outputs.tag-name }}
7272
runs-on: ubuntu-latest
7373
steps:
7474
- name: Dispatch to noir_wasm
7575
uses: benc-uk/workflow-dispatch@v1
7676
with:
77-
workflow: publish-noir-wasm.yml
77+
workflow: publish-es-packages.yml
7878
ref: master
7979
token: ${{ secrets.NOIR_REPO_TOKEN }}
80-
81-
publish-noir-js:
82-
name: Publish noir_js package
83-
needs: [release-please]
84-
if: ${{ needs.release-please.outputs.tag-name }}
85-
runs-on: ubuntu-latest
86-
steps:
87-
- name: Dispatch to noir_wasm
88-
uses: benc-uk/workflow-dispatch@v1
89-
with:
90-
workflow: publish-noir-js.yml
91-
ref: master
92-
token: ${{ secrets.NOIR_REPO_TOKEN }}
93-
94-
publish-source-resolver:
95-
name: Publish source resolver package
96-
needs: [release-please]
97-
if: ${{ needs.release-please.outputs.tag-name }}
98-
runs-on: ubuntu-latest
99-
steps:
100-
- name: Dispatch to source resolver
101-
uses: benc-uk/workflow-dispatch@v1
102-
with:
103-
workflow: publish-source-resolver.yml
104-
ref: master
105-
token: ${{ secrets.NOIR_REPO_TOKEN }}
106-
107-
publish-abi-wasm:
108-
name: Dispatch to publish-abi_wasm workflow
109-
needs: [release-please]
110-
if: ${{ needs.release-please.outputs.tag-name }}
111-
runs-on: ubuntu-latest
112-
steps:
113-
- name: Trigger publish-abi_wasm.yml workflow
114-
uses: benc-uk/workflow-dispatch@v1
115-
with:
116-
workflow: publish-abi_wasm.yml
117-
repo: ${{ github.repository }}
118-
token: ${{ secrets.GITHUB_TOKEN }}
119-
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }'
120-
121-
publish-acvm:
122-
name: Publish crates
123-
needs: [release-please]
124-
if: ${{ needs.release-please.outputs.tag-name }}
125-
runs-on: ubuntu-latest
126-
steps:
127-
- name: Dispatch to publish workflow
128-
uses: benc-uk/workflow-dispatch@v1
129-
with:
130-
workflow: publish-acvm.yml
131-
ref: master
132-
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'
133-
134-
publish-acvm-js:
135-
name: Dispatch to publish-acvm-js workflow
136-
needs: [release-please]
137-
if: ${{ needs.release-please.outputs.tag-name }}
138-
runs-on: ubuntu-latest
139-
steps:
140-
- name: Trigger publish-acvm-js.yml workflow
141-
uses: benc-uk/workflow-dispatch@v1
142-
with:
143-
workflow: publish-acvm-js.yml
144-
ref: master
145-
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'

.github/workflows/test-integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ jobs:
193193
- name: Install Yarn dependencies
194194
uses: ./.github/actions/setup
195195

196+
- name: Install Playwright
197+
uses: ./.github/actions/install-playwright
198+
196199
- name: Install jq
197200
run: sudo apt-get install jq
198201

Cargo.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ members = [
1616
"tooling/bb_abstraction_leaks",
1717
"tooling/lsp",
1818
"tooling/nargo",
19+
"tooling/nargo_fmt",
1920
"tooling/nargo_cli",
2021
"tooling/nargo_toml",
2122
"tooling/noirc_abi",
@@ -49,6 +50,7 @@ arena = { path = "compiler/utils/arena" }
4950
fm = { path = "compiler/fm" }
5051
iter-extended = { path = "compiler/utils/iter-extended" }
5152
nargo = { path = "tooling/nargo" }
53+
nargo_fmt = { path = "tooling/nargo_fmt" }
5254
nargo_cli = { path = "tooling/nargo_cli" }
5355
nargo_toml = { path = "tooling/nargo_toml" }
5456
noir_lsp = { path = "tooling/lsp" }
@@ -80,6 +82,7 @@ tower = "0.4"
8082
url = "2.2.0"
8183
wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] }
8284
wasm-bindgen-test = "0.3.33"
85+
js-sys = "0.3.62"
8386
base64 = "0.21.2"
8487
fxhash = "0.2.1"
8588
acir = { path = "acvm-repo/acir", default-features = false }

0 commit comments

Comments
 (0)