Debug changes for workflow #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test bb.js | |
on: | |
push: | |
branches: | |
- jb/bbjs-testing-workflow | |
jobs: | |
build: | |
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 Clang16 | |
run: | | |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | |
tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | |
sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ | |
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ | |
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ | |
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ | |
- name: Install libtinfo5 | |
run: sudo apt-get install -y libtinfo5 | |
- name: Set LD_LIBRARY_PATH | |
run: echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
- 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: Compile Barretenberg | |
run: | | |
cd cpp | |
cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert | |
cmake --build --preset default --target bb | |
- 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 | |
cat package.json | |
- name: Output bb.js package contents | |
run: | | |
cd nextjs-bbjs-demo/node_modules/@aztec/bb.js | |
ls -R | |
cat package.json | |
- name: Run dev and test scripts concurrently | |
run: | | |
cd nextjs-bbjs-demo | |
(timeout 600 npm run dev || exit 255) & # The exit code 255 is chosen to be distinct. | |
DEVPID=$! | |
sleep 10 | |
npm run test | |
wait $DEVPID | |
EXITCODE=$? | |
if [ $EXITCODE -eq 255 ]; then | |
echo "npm run dev timed out!" | |
exit 1 | |
fi |