Merge pull request #1843 from mintlayer/node-gui-backend-move #8278
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: Wasm build and test | |
on: | |
push: | |
branches: | |
- "**" # target all branches | |
pull_request: | |
branches: | |
- master | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_LOG: debug | |
RUST_BACKTRACE: full | |
jobs: | |
wasm_with_nodejs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Update local dependency repositories | |
run: sudo apt-get update | |
- name: Install dependencies | |
run: sudo apt-get install -yqq --no-install-recommends build-essential python3 python3-toml podman build-essential pkg-config libssl-dev | |
- name: Install rust deps | |
run: sudo apt-get install -yqq build-essential pkg-config libssl-dev | |
- uses: actions/checkout@v3 | |
- name: Install rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(python3 ./build-tools/rust-version-extractor/rust-version-extractor.py) | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install wasm-pack | |
run: cargo install wasm-pack | |
- name: Build the wasm module | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target nodejs | |
- name: Run the tests | |
working-directory: ./wasm-wrappers | |
run: node js-bindings/node-entry.js | |
wasm_artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update local dependency repositories | |
run: sudo apt-get update | |
- name: Install dependencies | |
run: sudo apt-get install -yqq --no-install-recommends build-essential python3 python3-toml podman build-essential pkg-config libssl-dev | |
- name: Install rust deps | |
run: sudo apt-get install -yqq build-essential pkg-config libssl-dev | |
- uses: actions/checkout@v3 | |
- name: Install rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(python3 ./build-tools/rust-version-extractor/rust-version-extractor.py) | |
- name: Install wasm-pack | |
run: cargo install wasm-pack | |
- name: Build the wasm module for nodejs - release | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target nodejs --out-dir wasm-wrappers-builds/nodejs/release --release | |
- name: Build the wasm module for nodejs - debug | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target nodejs --out-dir wasm-wrappers-builds/nodejs/debug --debug | |
- name: Build the wasm module for web - release | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target web --out-dir wasm-wrappers-builds/web/release --release | |
- name: Build the wasm module for web - debug | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target web --out-dir wasm-wrappers-builds/web/debug --debug | |
- name: Build the wasm module for bundler - release | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target bundler --out-dir wasm-wrappers-builds/bundler/release --release | |
- name: Build the wasm module for bundler - debug | |
working-directory: ./wasm-wrappers | |
run: wasm-pack build --target bundler --out-dir wasm-wrappers-builds/bundler/debug --debug | |
- name: Copy readme file into the package | |
working-directory: ./wasm-wrappers | |
run: cp README.md wasm-wrappers-builds/ && cp WASM-API.md wasm-wrappers-builds/ | |
- name: Create artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wasm_builds | |
path: | | |
./wasm-wrappers/wasm-wrappers-builds |