📝 write README #40
Workflow file for this run
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: on pull request | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
EM_VERSION: 3.1.72 | |
jobs: | |
check: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Check Lint and Format | |
run: pnpm check | |
build: | |
needs: check | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: ${{env.EM_VERSION}} | |
- name: resolve git submodule | |
run: git submodule update --init --recursive | |
- name: Build spz wasm binary | |
run: | | |
cd ./packages/core/lib/spz-wasm | |
mkdir ./build | |
em++ main.cpp \ | |
-Oz \ | |
--closure 1 \ | |
--llvm-lto 1 \ | |
-fno-exceptions \ | |
--std=c++17 \ | |
-lembind \ | |
--emit-tsd main.d.ts \ | |
-o ./build/main.mjs \ | |
-s USE_ZLIB=1 \ | |
-s WASM=1 \ | |
-s SINGLE_FILE=1 \ | |
-s MODULARIZE=1 \ | |
-s EXPORT_ES6=1 \ | |
-s EXPORT_NAME="spzwasm" \ | |
-s ALLOW_MEMORY_GROWTH \ | |
-s EXPORTED_FUNCTIONS="['_malloc', '_free']" | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: Build | |
run: pnpm build |