Skip to content

Commit

Permalink
Merge branch 'master' into clippy-errors
Browse files Browse the repository at this point in the history
* master:
  chore: Add deprecation message for default type in for loop (#2689)
  chore!: Change `noir-lang/noir-source-resolver` to `noir-lang/source-resolver` (#2718)
  chore: clippy fixes (#2719)
  chore: Integrate noir.js into workspace and CI release workflow (#2705)
  feat: Add initial version of noir.js (#2681)
  chore: switch `release-source-resolver.yml` to use yarn (#2704)
  chore: move stranded test to correct directory (#2701)
  chore(ci): deny wildcard dependencies (#2702)
  chore: fix `noirc_abi_wasm` publish for release-please (#2699)
  chore: introduce workspace for js packages (#2677)
  feat: Allow methods defined in a contract to be non-entry points (#2687)
  chore: revert some unwanted small changes from PR2180 (#2685)
  feat(lsp): Add nargo capabilities for test metadata (#2532)
  chore(ci): Add `cargo deny` workflow (#2682)
  • Loading branch information
TomAFrench committed Sep 15, 2023
2 parents b431985 + 9b77c1a commit 2ad51e8
Show file tree
Hide file tree
Showing 98 changed files with 4,163 additions and 12,542 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.15
node-version: 18.17.1
- name: Cache
uses: actions/cache@v3
id: cache
Expand Down
60 changes: 14 additions & 46 deletions .github/workflows/abi_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
- name: Build noirc_abi_wasm
run: |
nix build -L .#noirc_abi_wasm
cp -r ./result/nodejs ./tooling/noirc_abi_wasm
cp -r ./result/web ./tooling/noirc_abi_wasm
- name: Export cache from nix store
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
Expand All @@ -70,48 +72,13 @@ jobs:
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: ./tooling/noirc_abi_wasm
- name: Install workspace dependencies
run: |
yarn install --immutable
- name: Run node tests
working-directory: ./tooling/noirc_abi_wasm
run: yarn install && 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: Query playwright version
working-directory: ./tooling/noirc_abi_wasm
run: echo "PLAYWRIGHT_VERSION=$(yarn info @web/test-runner-playwright --json | jq .children.Version)" >> $GITHUB_ENV
run: |
yarn workspace @noir-lang/noirc_abi test
- name: Cache playwright binaries
uses: actions/cache@v3
Expand All @@ -121,18 +88,19 @@ jobs:
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./tooling/noirc_abi_wasm
- name: Query playwright version
working-directory: ./tooling/noirc_abi_wasm
run: echo "PLAYWRIGHT_VERSION=$(yarn info @web/test-runner-playwright --json | jq .children.Version)" >> $GITHUB_ENV

- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./tooling/noirc_abi_wasm
run: |
npx playwright install
npx playwright install-deps
- name: Run browser tests
working-directory: ./tooling/noirc_abi_wasm
run: yarn install && yarn test:browser
run: |
yarn workspace @noir-lang/noirc_abi test:browser
26 changes: 26 additions & 0 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: deny

on:
push:
branches: [master]
paths: [Cargo.lock]
pull_request:
branches: [master]
paths: [Cargo.lock]
merge_group:

env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always

concurrency: deny-${{ github.head_ref || github.run_id }}

jobs:
deny:
name: deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check all
52 changes: 52 additions & 0 deletions .github/workflows/noir-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release and Publish Noir Js

on:
workflow_dispatch:

jobs:
release-noir-js:
name: Release and Publish Noir Js
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: yarn install --immutable

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

- name: Install cargo and wasm-bindgen
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
cargo install -f wasm-bindgen-cli --version 0.2.86
- name: Install toml2json
run: |
source $HOME/.cargo/env
cargo install toml2json
- name: Install wasm-opt
run: |
npm i wasm-opt -g
- name: Install wasm32-unknown-unknwown target
run: |
rustup target add wasm32-unknown-unknown
- name: Build noirc_abi
run: yarn workspace @noir-lang/noirc_abi build

- name: Build noir_js
run: yarn workspace @noir-lang/noir_js build

- name: Authenticate with npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to NPM
working-directory: ./tooling/noir_js
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
17 changes: 11 additions & 6 deletions .github/workflows/publish-abi_wasm.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Publish ABI Wasm

on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
noir-ref:
description: The noir reference to checkout
required: true

jobs:
noirc-abi-wasm-build:
Expand All @@ -15,6 +16,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
repository: "noir-lang/noir"
ref: ${{ inputs.noir-ref }}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -39,8 +43,9 @@ jobs:
mkdir temp_publish_dir
cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/
- name: Publish to NPM
- name: Publish to npm
working-directory: ./temp_publish_dir
run: npm publish
run: |
npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 5 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ jobs:
- name: Test built artifact
if: matrix.target == 'x86_64-apple-darwin'
run: |
cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/
cd release-tests
yarn install
yarn test
cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/
yarn install --immutable
yarn workspace release-tests test
- name: Upload binaries to release tag
uses: svenstaro/upload-release-action@v2
Expand Down Expand Up @@ -145,10 +143,8 @@ jobs:
if: startsWith(matrix.target, 'x86_64-unknown-linux')
run: |
cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/
cd release-tests
yarn install
yarn test
yarn install --immutable
yarn workspace release-tests test
- name: Upload binaries to release tag
uses: svenstaro/upload-release-action@v2
Expand Down
35 changes: 3 additions & 32 deletions .github/workflows/release-source-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Release and Publish Source Resolver

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

jobs:
release-source-resolver:
Expand All @@ -15,39 +11,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Bump version
working-directory: ./compiler/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: ./compiler/source-resolver
run: npm install
run: yarn install --immutable

- name: Build noir-source-resolver
working-directory: ./compiler/source-resolver
run: npm run build
run: yarn workspace @noir-lang/source-resolver build

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

- name: Configure git
run: |
git config user.name kevaundray
git config user.email kevtheappdev@gmail.com
- name: Commit updates
run: |
git add compiler/source-resolver/package-lock.json
git add compiler/source-resolver/package.json
git commit -m "chore: Update source-resolver to ${{ env.NEW_VERSION }}"
git push
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,43 @@ jobs:
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }'

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: 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: release-source-resolver.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

dispatch-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 }}" }'
Loading

0 comments on commit 2ad51e8

Please sign in to comment.