Skip to content
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
82 changes: 82 additions & 0 deletions .github/workflows/bbjs-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test bb.js

on:
push:
branches:
- jb/bbjs-testing-workflow

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
ref: bbjs-tests
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