Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add bbjs testing workflow #1733

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions circuits/cpp/barretenberg/.github/workflows/bbjs-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test bb.js

on:
push:
branches:
- "**"

jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Install bleeding edge cmake
run: |
sudo apt -y remove --purge cmake
sudo snap install cmake --classic

- name: Create Build Environment
run: |
sudo apt-get update
sudo apt-get -y install ninja-build yarn

- name: Install yarn
run: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt -y update && sudo apt -y install yarn

- name: Install WASI-SDK
run: |
cd cpp
./scripts/install-wasi-sdk.sh

- name: Compile Typescript
run: |
cd ts
yarn install && yarn && yarn build

- name: Pack the library for npm
run: |
cd ts
npm pack
echo "TARBALL_NAME=$(ls *.tgz)" >> $GITHUB_ENV

- name: Checkout nextjs-bbjs-demo repository
uses: actions/checkout@v3
with:
repository: noir-lang/nextjs-bbjs-demo
path: nextjs-bbjs-demo

- name: Update package.json to point to local tarball dependency
run: |
jq ".dependencies[\"@aztec/bb.js\"] = \"file:../ts/${TARBALL_NAME}\"" nextjs-bbjs-demo/package.json > nextjs-bbjs-demo/package.temp.json
mv nextjs-bbjs-demo/package.temp.json nextjs-bbjs-demo/package.json
cat nextjs-bbjs-demo/package.json

- name: Install dependencies in nextjs-bbjs-demo
run: |
cd nextjs-bbjs-demo
npm install

- name: Output bb.js package contents
run: |
cd nextjs-bbjs-demo/node_modules/@aztec/bb.js

- name: Run dev and test scripts concurrently
run: |
cd nextjs-bbjs-demo
npm run dev
sleep 30
npm run test